0
How the " char *atr "-works,what is it working principle and and explain the code ,why this makes a answer " fg " ?.
char *atr; char srr[]={"abcdefg"}; tr=srr; atr+=5; cout<<atr<<\n;
2 odpowiedzi
+ 1
char *atr; // charecter pointer
char str[] = "abcdefg" ; //charecter array assigned with sequence of letters..
atr = str ; // now both point to the same charecter sequence..
atr = atr + 5; now atr pointer is advanced to 5 charecter locations further in sequence so now it points to "fg"
"abcdefg"
012345
cout <<atr; output fg.