Hi all. This is probably an easy one for you guys. Why is it that when I declare a pointer variable that points to an 'int', the pointer variable stores the address of the 'int' that it points to. However when I declare a pointer that points to a 'char' variable, the pointer variable appears to store the value stored in the 'char' it points to...not its address. My code below should help explain what I mean.
The extraction operators have a special function for only char* that prints the data pointed to by the pointer until it reaches a null character ('\0'). This is for compatibility with C-style strings. Cast the char* to something else to see the actual address.
thanks a lot for the quick responses guys, much appreciated. I don't need to know for any real purpose, just more curiousity. However, I can't change the char* to an int* since it is pointing to a char not an int right?