0

How the line 11 to 17 working? Anyone explain the pointer lil bit?

::Any body explain the line 11 to 17 how it is working. Here I'm working on pointer and it gives same result on different syntax and some time different value. Any body explain the line 11 to 17 how it is working. https://code.sololearn.com/c1Xrt51JoONd/?ref=app

14th Sep 2022, 5:43 PM
Samarendra Singh
Samarendra Singh - avatar
2 ответов
+ 1
#include <stdio.h> int main() { int a[2][3]={2,3,4,5,6,7}; //your array is actually equal to //int a[2][3]={{2,3,4},{5,6,7}}; with proper bracing... // in pointer notation, a[i][j] can represented as *(*(a+i)+j); printf("%d\n",(a+1));//pointer point to second row, meaning first row is i=0'th printf("%d\n",(*a+1));//pointer first row and second column printf("%d\n",(*(a+1)));//pointer points to second row printf("%d\n",(*(*a+1))); //so this is equal to a[0][1] printf("%d\n",(*(*(a+1)))); // this is equal to a[1][0] return 0; }
14th Sep 2022, 8:29 PM
Jayakrishna 🇮🇳
0
I think now Im lil bit getting this.are those syntax of pointer of pointers?🤔😬
14th Sep 2022, 6:19 PM
Samarendra Singh
Samarendra Singh - avatar