+ 2
We known that the * operator is used for declaration of pointer and we can only put the address in the pointer eg int *p=&a;
why this code running char*c="c+"; //pointer only takes address cout<<c<<endl; c++; cout<<c; /*output c+ + */
5 odpowiedzi
+ 9
pointer can be used to declare arrays and strings and it always points to the first element in that array or string.
+ 4
Yes, we pass to cout, but if cout sees it is a pointer to a character array (a.k.a string) it will print that string. If you want to determine how a pointer should be shown you can use printf(), you can print its address with something like %d, the first character with %c and the whole string with %s.
+ 3
Because it is a pointer to a two character array. When you increment the pointer you move it to the next value in the array.
+ 1
thanks #vlad and #mazen...
0
if its pointer to char array then we will only pass the address to the pointer but in this program we r passing the string that contains two character..