Created
March 16, 2017 08:22
-
-
Save wtakuo/921a735b31bf0f342cb7cc4864b1e8dd to your computer and use it in GitHub Desktop.
Prints data sizes
This file contains hidden or 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 <stdio.h> | |
| #define print_size(t) printf("sizeof(%s) = %zu\n", #t, sizeof(t)) | |
| int main(void) { | |
| print_size(char); | |
| print_size(short); | |
| print_size(int); | |
| print_size(long); | |
| print_size(long long); | |
| print_size(char *); | |
| print_size(void *); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment