What is c++ verison of %p?

Started by
1 comment, last by xorjesus 19 years, 10 months ago
I''m trying to print the address of a pointer to a string''s individual characters, but I can only get ascii data using cout << &(str[0]); Using printf("%p", &(str[0]) will give the address. How can I achieve this in c++? Thank you for any help.
I study day and night, memorizing the game.
Advertisement
Cast the pointer to void*.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
sweet thanx, I love (void *)!
I study day and night, memorizing the game.

This topic is closed to new replies.

Advertisement