SHARE
TWEET

short int array in C99

DulcetAirman Mar 10th, 2017 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     printf("array:\n");
  6.     short int array[4][3]={{1},{2,3},{4,5,6}};
  7.    
  8.     for(int i = 0; i < 4; i++) {
  9.         printf("\n[%d]:\n", i);
  10.         for(int j = 0; j < 3; j++) {
  11.             printf("[%d][%d]: %d \n", i, j,  array[i][j]);
  12.         }
  13.     }
  14.    
  15.     printf("size = %d \n", sizeof(array));
  16.     printf("length = %d \n", sizeof(array) / sizeof(short int));
  17.  
  18.  
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top