according to the definition
char *str = "ankit"
here str
is a pointer to char.
when we do something like
cout<< str;
then it is printing ankit. why not the address where ankit is stored, as str
is a pointer so it must be a address
I have tried to print *str
which comes out to be "a"; which I can understand but I am unable to understand why printing str is not giving pointer but the string value.
char * str = "ankit";
cout<< str;
output : ankit