0
Can anyone explain the output?
int main(){ char *p = "abcde"; cout << *p++; // consider necessary files are included } output :: a //actually i want to know what is happening in line 3. please explain it....
2 Respostas
+ 1
*p is a pointer to the string. It points to the 1st char which is "a" here.
3rd line prints the value of *p (i.e. a) and increments the pointer to make it point to b.
If you write cout << *p; after 3rd line, you will see output as b.
0
ok i got it thanks.....