Hello!
Pleas, I can't google the answer, how to get NORMAL addres in char pointer!!!
I tried in codepad and in ideone, please delete if the page accepts my last 2 trials, cause I do not see them right now (it said error) .
Please have a look at the output in ideone, it is even mroe interesting!!!
Many thanks!!!
if you just want the address you can cast the char* to a void* and output that. If you just want the dereferenced character your *pletter is the correct choice.
The process is simple, here it is in more verbose terms:
1 2 3 4 5 6 7 8 9 10 11
char myCharVar = 'a';
//a regular char pointer is treated like a string
char* myCharPointer = &myCharVar;
//so we have to "cast" it to a different type, void* is simply a pointer without a type
//putting a type in () before a variable/type/value "casts" or converts it into the type
//in ()
void* myCharVoidPointer = (void*)myCharPointer;
std::cout << myCharVoidPointer;