GaijinPunch
MIS
I've still not gotten my Accelerated C++ book, but I've had some free time at work, so I figured web tutorials wouldn't hurt. I've gotten up to a tutorial on pointers. Since my only programming experience is shell scripting, pointers is a bit foreign to me.... never done (or needed to) do it before.
Basically, here's an excerpt from the page I'm using.
char * terry = "hello";
"Assuming that in memory, terry starts at block 1702: it is important to indicate that terry contains value 1702 and not 'h' nor "hello", although 1702 points to these last ones."
So, in that case, I tried the following:
cout << terry << endl; // hello
cout << *terry << endl; // h
cout << &terry << endl; // 0x80498c4
Should I assume if you want to find out "where" something is stored in memory, must always preclude it w/ the ampersand, and that even though a pointer carries this location, it will output the value?
Thanks
Basically, here's an excerpt from the page I'm using.
char * terry = "hello";
"Assuming that in memory, terry starts at block 1702: it is important to indicate that terry contains value 1702 and not 'h' nor "hello", although 1702 points to these last ones."
So, in that case, I tried the following:
cout << terry << endl; // hello
cout << *terry << endl; // h
cout << &terry << endl; // 0x80498c4
Should I assume if you want to find out "where" something is stored in memory, must always preclude it w/ the ampersand, and that even though a pointer carries this location, it will output the value?
Thanks