|
|||||||||||
Technical Support Support Resources
Product Information |
GENERAL: DEFINING A STRING ON THE COMPILER COMMAND LINEInformation in this article applies to:
SYMPTOMCan I use the DEFINE command line option to pass a string to my program at compile time? CAUSEThough you can't pass a complete string using the DEFINE option, you can pass individual characters. RESOLUTIONIf 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 MORE INFORMATIOSEE ALSO
Last Reviewed: Wednesday, February 28, 2018 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.