Skip to content

Instantly share code, notes, and snippets.

@khanzf
Last active June 19, 2019 07:32
Show Gist options
  • Save khanzf/e12840c7e2c62f52c01526ad07287eee to your computer and use it in GitHub Desktop.
Save khanzf/e12840c7e2c62f52c01526ad07287eee to your computer and use it in GitHub Desktop.
#include <sys/stat.h>
#include <stdio.h>
#include <stdint.h>
int main() {
printf("struct stat: %lu\n", sizeof(struct stat));
printf("struct stat->st_dev %lu\n", sizeof(unsigned long));
printf("struct stat->ctime_nsec: %lu\n", sizeof(unsigned long));
printf("unsigned long: %lu\n", sizeof(unsigned long));
printf("uint64_t: %lu\n", sizeof(uint64_t));
printf("uint32_t: %lu\n", sizeof(uint32_t));
printf("unsigned long: %lu\n", sizeof(unsigned long));
printf("int: %lu\n", sizeof(int));
printf("short: %lu\n", sizeof(short));
printf("unsigned int: %lu\n", sizeof(unsigned int));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment