|ARM Technical Support Knowledge Articles|
Applies to: General Topics
Information in this article applies to:
How do I convert a constant passed to a #define macro into a text string?
Pass the parameter to a stringizing macro as shown below:
#define NUMBER B85800 // this can be defined in the command line #define VAL(str) #str #define TOSTRING(str) VAL(str) unsigned char part1 = TOSTRING (NUMBER); // generates "B85800" unsigned char part2 = VAL(NUMBER); // generates "NUMBER"
Article last edited on: 2001-03-19 00:00:00
Did you find this article helpful? Yes No
How can we improve this article?