0
This code in 2nd line pointer access the char and + 5 . But how it's show output learn. Plz explain
Char *ptr= "solo learn"; Printf(ptr +5);
3 Answers
+ 1
🔽<ptr> 🔽<ptr> + 5
——————————————————
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| S | O | L | O | | L | E | A | R | N |
——————————————————
Pointer <ptr> points to the first character of string. Add 5 to <ptr>, then it points to address of the sixth character (index 5). From this point on, the characters will be printed until string terminator is found.
+ 1
Thank you Ipang . Got it.
0
No problem Suparna Podder 👌