Basically tried to get a pointer of char array to return the address of the elements as well as the values of said elements.
However even though the value is returned fine the address is... odd.
Here is code and output:
CODE:
pcpointer = &firstChar[0];
cout << "The pointer pnpointer is looking at " << pcpointer << " with the value " << *pcpointer << endl;
pcpointer++;
cout << "Increment the pointer then we would look at address " << pcpointer << " with the value of " << *pcpointer << endl;
OUTPUT:
Please now enter a value for the first char: g
Please now enter a value for the second char: f
The pointer pnpointer is looking at gf6 " with the value g
Increment the pointer then we would look at address f7 " with the value of f
See what I mean? Instead of producing a hex memory address it produces this "mish mash" of values and what looks like random numbers.
Is this right? Am I just being dumb? It's okay I can take the truth!
And again thank you looking into this for me.
P.S. As soon as I change the pointer and array type to int the addresses that are returned are fine.