xref: /petsc/src/benchmarks/sizeof.c (revision abdd934af67c1cc360c4d0cfcf2de16e188d627e)
1*bad762beSSatish Balay #include <stdio.h>
28c1b1b9eSSatish Balay /*
38c1b1b9eSSatish Balay         Prints the size of various C data types
48c1b1b9eSSatish Balay */
main(int argc,char ** args)5*bad762beSSatish Balay int main(int argc, char **args)
62e762c34SBarry Smith {
7593a00baSSatish Balay   fprintf(stdout, "long double : %lu\n", (unsigned long)sizeof(long double));
8593a00baSSatish Balay   fprintf(stdout, "double      : %lu\n", (unsigned long)sizeof(double));
9593a00baSSatish Balay   fprintf(stdout, "int         : %lu\n", (unsigned long)sizeof(int));
10593a00baSSatish Balay   fprintf(stdout, "char        : %lu\n", (unsigned long)sizeof(char));
11593a00baSSatish Balay   fprintf(stdout, "short       : %lu\n", (unsigned long)sizeof(short));
12593a00baSSatish Balay   fprintf(stdout, "long        : %lu\n", (unsigned long)sizeof(long));
13593a00baSSatish Balay   fprintf(stdout, "long long   : %lu\n", (unsigned long)sizeof(long long));
14593a00baSSatish Balay   fprintf(stdout, "int *       : %lu\n", (unsigned long)sizeof(int *));
15593a00baSSatish Balay   fprintf(stdout, "size_t      : %lu\n", (unsigned long)sizeof(size_t));
162e762c34SBarry Smith 
172e762c34SBarry Smith   return 0;
182e762c34SBarry Smith }
19