0
Can you Explain this code's output?
#include <stdio.h> #include <stdlib.h> int main(void) { int i,j; int **p = (int **)malloc(2 * sizeof(int *)); p[0] = (int *)malloc(2 * sizeof(int)); p[1] = p[0]; for(i = 0; i < 2; i++) { for(j = 0; j < 2; j++) { p[i][j] = i + j; printf("%d\n",p[0][0]); }} printf("\n%d",p[0][0]); return 0; }
1 ответ