Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5
&arr points to entire array so &arr+1 points to after the whole array (like 2d array which points to next row) arr points to the first element of array so arr+1 points to next element (like next value in same colomn). So (arr+1) points second element and *(arr+1) returns 41 &arr+1 points to after arr array so ptr points to same and (ptr-1) points to last element of arr array because it's assigned ptr = &arr + 1; So *(ptr-1) returns 42. Hope it helps..
8th Aug 2022, 2:29 PM
Jayakrishna 🇮🇳
+ 3
I made a little test. It's actually iterating backwards. https://code.sololearn.com/cqgglI9mS537/?ref=app
8th Aug 2022, 2:58 PM
Jan
Jan - avatar
+ 2
arr¬¡--------------¡ | 40 | 41 | 42 | x | x | x | !¦______¦ (&arr+1)=(arr + sizeof arr) in addition to what Jayakrishna🇮🇳 said, you must use some peace of paper to better anderstand pointers hh
8th Aug 2022, 2:43 PM
Amine Laaboudi
Amine Laaboudi - avatar