Hello everyone,
I have tried that even if I have multiple character pointer variables, if the content they pointed to are the same, they are allocated with the same value. So, I think from compiler point of view, the constant with the same content shares the single copy in memory?
Here is my test program in Visual Studio 2005.
Code:#include <windows.h> int main (int argc, char** argv) { char* abc = "Hello"; char* abc2 = "Hello"; // the value (address) of abc is the same as abc2 return 0; }
thanks in advance,
George