hi my question is that: we have a constant that we want to store in program memory.is this true:
Code:
const char c="hi"; char a; a=c; printf("a is %S",c);
and similar to it for eeprom data:
eeprom char c="hi"; a=c; printf("a is %S",c);
we didnt find eeprom in manual but think it should be in.
In C, a character variable stores one (1) character. Not a text string.
"hi" is not a single character. 'h' is a single character. 'i' is another character.
So you either need to play with character arrays (can't be assigned with '=' but requires copying element for element - either directly or by using one of the available functions in the CRTL) or play with pointers.
mr per.
you gave a great answer and lots to learn. thanks.
Most variables are ultimately positioned into the memory. The exceptions are non-auto variables which are qualified as 'const', which are placed in the program, or 'eeprom' qualified variables.