[ create a new paste ] login | about

Link: http://codepad.org/l5z4DFTe    [ raw code | output | fork ]

C, pasted on Mar 1:
1
2
3
4
5
6
7
#include <stdio.h>
int main(void) {
  int arr[][5] = {{1,2,3,4,5}, {5,6,7,8,9}, {6,5,4,3,2}};
  printf("sizeof arr is %d bytes\n", (int)sizeof arr);
  printf("number of elements: %d\n", (int)(sizeof arr/sizeof arr[0]));
  return 0;
}


Output:
1
2
sizeof arr is 60 bytes
number of elements: 3


Create a new paste based on this one


Comments: