Hello Everyone ,
I've this strange problem with using char pointer in my c++ programme with the gcc compiler (version 3.4.2).
char a='A';
char *c=&a;
printf("%p %c\n",c,*c);
std::cout<<c<<" "<<*c<<std::endl;
I expect the output of printf and cout to be same but why am I getting strange output like this.
output :-
0022FF27 A
Ah " A
Now If I change char a='A' with char a='C'
output is :-
0022FF27 C
Ch " C
Is their anyone who can explain this. Thank you a million in advance. Please help me .