I\'ve been looking through the site but haven\'t found an answer to this one yet.
It is easiest (for me at least) to explain this question with an example.
I
When you do char* mystr = "foo";
, the compiler will create the string "foo"
in a special read-only portion of your executable, and effectively rewrite the statement as char* mystr = address_of_that_string;
The same is not implemented for any other type, including integers. int* myint = 5;
will set myint
to point to address 5
.