| |||||
Technical Support Support Resources
Product Information | C166: CONSTANTS IN SPECIFIC MEMORY AREASInformation in this article applies to:
QUESTIONI have a large pointer array for text constants. Here is a simplified example:
const unsigned char *text[]= { "text1", "text2", "text3", };
However, this text is allocated in NCONST (near) memory. I would like to have this text in other ROM spaces, for example in HCONST (huge), since there is no more space in my NCONST space. How may I achieve that? ANSWERJust specify the correct memory type in your definition. For example:
unsigned char const huge *text[]= { "text1", "text2", "text3", }; // for HCONST
unsigned char const far *text[]= { "text1", "text2", "text3", }; // for FCONST
Note that this works only if you are using C166 Version 4.24 or higher. To access such variables you can use the following functions:
SEE ALSOLast Reviewed: Saturday, April 24, 2004 | ||||
| |||||