|ARM Technical Support Knowledge Articles|
Applies to: General Topics
Information in this article applies to:
Can I use the DEFINE command line option to pass a string to my program at compile time?
Though you can't pass a complete string using the DEFINE option, you can pass individual characters.
If you want define a string, you need to break it up into individual characters, as shown below.
C51 define(VERSION="'V','e','r','s','i','o','n',' ','1','.','0','b','e','t','a'")
The symbol VERSION can then be used in your C code as follows,
#ifdef VERSION char VersionString = VERSION,0; #else char VersionString = "No Version Information"; #endif
Article last edited on: 2004-05-01 20:03:34
Did you find this article helpful? Yes No
How can we improve this article?