Where does a const
variable gets stored exactly and how does it behaviour change? Say for example:
const int i=10; // stores where ?
main()
Its totally up to the compiler writer what happens to the const, and it will vary according to the optimisation you request.
In your first example the constants are never used so the compiler probably will just ignore them altogether.
In your second example as you use "address off" it must actualy store it somewhere -- probably at the begining of the stack.
As C is designed to replace assembly language instructions, and for writing OS kernal and device driver type code it lets you do all sorts of things and assumes you know what you are doing when you start messing with pointers.