I was wondering why if I run the code below I get the following, "SPOCK@ a" I get that it will begin at the beginning of the arrays memory location but shouldn't the compiler return an actual address value in hex for the array mem location?
This function is being called: ostream& operator<< (ostream& os, constchar* s)
What does that function do? It puts the character being pointed to into the output stream, and all the characters that follow it in memory, until it finds a zero value.
shouldn't the compiler return an actual address value in hex for the array mem location?
That's simply not what the ostream& operator<< (ostream& os, constchar* s) operator does.
However, there are operators that take pointers of other types that DO output the value of that pointer, rather than output what is being pointed at.
The difference is a convenience for the programmer; it's common to want to output some char values and common to have a pointer to the first one.