Skip to content

Instantly share code, notes, and snippets.

@kost
Created December 11, 2019 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kost/3a04f949eb803ec6144c83ecb302bfc5 to your computer and use it in GitHub Desktop.
Save kost/3a04f949eb803ec6144c83ecb302bfc5 to your computer and use it in GitHub Desktop.
Test sizes of primitives on different archs
#include <stdio.h>
main()
{
fprintf(stdout, "size of char: %d\n", sizeof(char));
fprintf(stdout, "size of short: %d\n", sizeof(short));
fprintf(stdout, "size of int: %d\n", sizeof(int));
fprintf(stdout, "size of char_p: %d\n", sizeof(char *));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment