0
What is the output of the code?đ Pls explain
char*a ="coding"; char*b=(++a)+3; cout <<*b
2 Answers
+ 4
answer: 'n'.
a is a pointer to the first value of the string a[0] = 'c'.
so (++a) means a[1], which is the value of 'o', then +3 = a[1+3] -> a[4] so now b is a pointer to the memory adress of a[4] when you use cout<<*b; it says give me the value in the location you are pointing which is 'n'. couse a[4] = 'n'.
0
thnx