Advertisement
Wojtekd

Type Sizes

Feb 6th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main ( void )
  5. {
  6.     // reprezentacje typów
  7.        
  8.     printf("\n");
  9.     // floaty
  10.     printf("float: %d\n",sizeof(float));
  11.     printf("double: %d\n",sizeof(double));
  12.     printf("long double: %d\n",sizeof(long double));   
  13.    
  14.     printf("\n");
  15.     // inty
  16.     printf("short int: %d\n",sizeof(short int));
  17.     printf("short: %d\n",sizeof(short));
  18.     printf("int: %d\n",sizeof(int));
  19.     printf("long int: %d\n",sizeof(long int));
  20.     printf("long: %d\n",sizeof(long));
  21.     printf("long long: %d\n",sizeof(long long));
  22.    
  23.     printf("\n");
  24.     // inne
  25.     printf("char: %d\n",sizeof(char));
  26.    
  27.     printf("\n");
  28.     system("pause");
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement