Saturday, May 9, 2009

Where does const variable in c code in memory reside?

It sits in the heap that is allocated to your program by the OS. It doesn't reside anywhere special, it is just marked read only. There are ways around that if you really try.

Where does const variable in c code in memory reside?
I think it's compiled into the static data area of the executable. Sorry that's not very specific, but that's as much as I know.

survey monkey

No comments:

Post a Comment