character pointer worries
this may sound strange, but each time i try to print the address of a character, it prints out the character.
for example,
Code:
char c='a',*p;
p=&c;
cout<<p;
gives the output 'a'.
i can get over it using void pointers, but why does the above happen and is there any other way out?
Re: character pointer worries
Quote:
Originally posted by kiss_psycho
why does the above happen and is there any other way out?
That's usually what you want to happen - after all, we use char *'s for C-style strings, so that's how cout handles it. Casting to a void pointer should be just fine.