NH> char aStr[10] = "abcdefgh";
NH> char * aPtr = &aStr[5];
NH> cout << aPtr << endl;
DM> You want:
DM> cout << (void*)aPtr << endl;
Just an honest question: why, after aPtr was declared to be a pointer
to char, would you need to cast it in order to print the address
(contents of the pointer).
Instead of a C-style cast, would it be preferred in that situation to
do:
cout aPtr << end;
* KWQ/2 1.2i *
--- TMail v1.31.5
---------------
* Origin: Diablo Valley PCUG-BBS, Walnut Creek, CA 510/943-6238 (1:161/55)
|