fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int *A[2];
  5. int B[2][2];
  6. int **C;
  7. puts("Type of A - int *[2], type of B - int [2][2], type of C - int **");
  8. puts("int *[2] != int [2][2]");
  9. printf("sizeof(int *[2]) == %2d, sizeof(int [2][2]) == %2d, sizeof(int **) == %2d\n",
  10. sizeof(A), sizeof(B), sizeof(C));
  11. printf("sizeof(int *) == %2d, sizeof(int [2]) == %2d, sizeof(int *) == %2d\n",
  12. sizeof(*A), sizeof(*B), sizeof(*C));
  13. printf("sizeof(int) == %2d, sizeof(int) == %2d, sizeof(int) == %2d\n",
  14. sizeof(**A), sizeof(**B), sizeof(**C));
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
Type of A - int *[2], type of B - int [2][2], type of C - int **
int *[2] != int [2][2]
sizeof(int *[2]) ==  8, sizeof(int [2][2]) == 16, sizeof(int **) ==  4
sizeof(int *)    ==  4, sizeof(int [2])    ==  8, sizeof(int *)  ==  4
sizeof(int)      ==  4, sizeof(int)        ==  4, sizeof(int)    ==  4