Keil™, An ARM® Company

Technical Support

C166: LOCATING ARRAYS OF STRINGS IN ROM


Information in this article applies to:

  • C166 All Versions

QUESTION

How do I locate arrays of pointers in ROM? I have written the following declaration with the strings stored in ROM as consts; however, the array itself is stored in RAM. How do I store the array in ROM as well?

const char *array[] = {"String 1","String 2", "etc..."};

ANSWER

You must declare the array as const. The following line will do the trick:

const char *const array[] = {"String 1","String 2", "etc..."};

MORE INFORMATION

SEE ALSO

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure