This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

flash and eeeprom

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:

Code:

eeprom char c="hi";
a=c;
printf("a is %S",c);

we didnt find eeprom in manual but think it should be in.

Parents
  • 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.

Reply
  • 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.

Children