
March 17th, 2010, 03:21 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Location: San Francisco Bay
|
|
It should work if you cast it to void *. cout << x is overloaded differently for char * and other pointers: for the former, it prints the string x points to, and for the latter, it prints the address (i. e., literally the value of x as a pointer).
I could also answer your real concern ("I wonder the address values of each element of an array. Does str[0] have a lower address than str[1]?"), but you're so close to discovering the answer yourself, so I won't. 
|