I have confusion regarding pointers, why 1D array and 2D array works differently. For e.g. I have written a code
#include <stdio.h>
int main(){
int arr[6]={1,2,3,4,5,6};
int marr[3][3]={11,22,33,44,55,66,77,88,99};
printf("%d\n",*arr);
printf("%d",*marr);
return 0;
}
//-----------------output-------------------------------------
bleepblop@bleep-M-74EW C_Program % gcc -o array array.c
array.c:8:14: warning: format specifies type 'int' but the argument has type 'int *' [-Wformat]
printf("%d",*marr);
~~ ^~~~~
1 warning generated.
bleepblop@bleep-M-74EWC_Program % ./array
1
-1167960528
isn’t *marr suppose to print ‘11’ in place of some longed signed value.