Last active
December 2, 2019 09:49
-
-
Save sgqy/b37f8b47d4629abddb711952aad7ca1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <cstdio> | |
#define print_size(x) printf("%20s: %2ld byte, %2ld bit\n", #x, sizeof(x), sizeof(x) * 8) | |
int main() | |
{ | |
print_size(char); | |
print_size(short); | |
print_size(int); | |
print_size(long); | |
print_size(long long); | |
print_size(uint8_t); | |
print_size(uint16_t); | |
print_size(uint32_t); | |
print_size(uint64_t); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment