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

Can a struct contain RAM and ROM variables simultaneously?

hi all,

Structures in C are supposed to be a contiguous block of memory. But what if I need my structure to contain some data variables in RAM, and some constant that can be located in ROM? I don't want to leave the constant in RAM to waste its space.

How can such a struct be declared? Thanks

0