Created
April 5, 2013 02:48
-
-
Save fritz0705/5316214 to your computer and use it in GitHub Desktop.
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
| /* gcc -o intlen intlen.c */ | |
| #include <stdio.h> | |
| #define TYPE_INFO(type) #type, (sizeof(type) * 8), sizeof(type) | |
| #define TYPE_FORMAT "%s\t%u\t%u\n" | |
| int main(void) | |
| { | |
| puts("type\tbits\tbytes"); | |
| printf(TYPE_FORMAT, TYPE_INFO(char)); | |
| printf(TYPE_FORMAT, TYPE_INFO(short)); | |
| printf(TYPE_FORMAT, TYPE_INFO(int)); | |
| printf(TYPE_FORMAT, TYPE_INFO(long)); | |
| printf(TYPE_FORMAT, TYPE_INFO(long long)); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment