Advertisement
grizlik

sizes of int

May 19th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdint.h>
  3.  
  4. #define PRINT_SIZE(t) std::cout << "Size of " #t ": " << sizeof(t) << std::endl
  5.  
  6. int main()
  7. {
  8.     PRINT_SIZE(int8_t);
  9.     PRINT_SIZE(int_fast8_t);
  10.     PRINT_SIZE(int16_t);
  11.     PRINT_SIZE(int_fast16_t);
  12.     PRINT_SIZE(int32_t);
  13.     PRINT_SIZE(int_fast32_t);
  14.     PRINT_SIZE(int64_t);
  15.     PRINT_SIZE(int_fast64_t);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement