hi
i want to know where & how the C variables gets stored
i mean like volatile , pointer and string variables gets stored ,
whether it is on stack or some other places
The nice thing with C is that you do not have to think about this
when you program in standard C. Whenever you think about these details
you loose the portability of your program, since the storage of the
variables is left for the discretion of the implementors.
The concept of stack is not part of the language, but variables with
automatic storage (local variables without the static keyword) are
stored by most systems on some sort of stack. The global variables
and those declared with the static keyword are stored in a designated
section of memory, and they are initialised before main() is called.
The memory for dynamical variables are asked from the operating system,
whenever you call malloc(). There is an other storage class specifier,
register, which suggests that the variable should be stored in a cpu register,
but compilers are free to ignore that keyword (but all have to document
the effect of the register keyword.)
The qualifiers (e.g. const, volatile) do not affect the storage, but they
do have an impact on the access to those variables.
It is difficult to tell more without knowing your system and your intentions.
It is not polite to ask if you really need the information you have asked for,
but it is difficult to resist.
Szabolcs