Hi,
Before, I've tried to understand C++, yet I didn't get very far with the pointers... I've started a new try, and now I'm getting the hang of it better.
However, one thing stuck me on this page:
http://www.cplusplus.com/doc/tutorial/pointers/
I understand, if you want to point to an int, the following would not work:
int * a = 35;
As the number you would assign would become the memory-address, and not the actual value. Assuming b is an ordinary int, this would work fine however:
int * a = &b;
as the memory-address of a would become the memory-address of b.
Till now I'm right, isn't it?
Yet, there is one piece of code:
char * terry = "hello";
Thinking in the same way as the int* above, I would suspect here I would be doing the same: The memory-address would become "hello". But this obviously isn't the case, is it?
Is there any reasonable explanation for this? And viewing from a greater perspective, are there more types where this occurs?
Thanks in advance,
Marco