datasize.c
上传用户:wudi5211
上传日期:2010-01-21
资源大小:607k
文件大小:1k
- /*
- * datasize.c -- print the size of common data items
- *
- * Obviously, this run with any kernel and any Unix
- */
- #include <stdio.h>
- #include <sys/utsname.h>
- int main(int argc, char **argv)
- {
- struct utsname name;
- uname(&name); /* never fails :) */
- printf("system/machine: %s %sn",name.sysname,name.machine);
- printf("sizeof(char) = %in",(int)sizeof(char));
- printf("sizeof(short) = %in",(int)sizeof(short));
- printf("sizeof(int) = %in",(int)sizeof(int));
- printf("sizeof(long) = %in",(int)sizeof(long));
- printf("sizeof(longlong) = %in",(int)sizeof(long long));
- printf("sizeof(pointer) = %in",(int)sizeof(void *));
- return 0;
- }