Keil Logo

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
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

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.