ARM Technical Support Knowledge Articles

LOCATING ARRAYS OF STRINGS IN ROM

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2005-07-15 13:16:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential