#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <assert.h> #include <math.h> #include <time.h> #include <limits.h> #include <float.h> #include <ctype.h> #include <locale.h> #include <setjmp.h> #include <signal.h> #include <errno.h> #include <stddef.h> #include <wchar.h> #include <wctype.h> #include <stdint.h> // typedef signed char int8_t; // typedef short int16_t; // typedef int int32_t; // typedef long long int64_t; // typedef unsigned char uint8_t; // typedef unsigned short uint16_t; // typedef unsigned int uint32_t; // typedef unsigned long long uint64_t; #define print_size(x) printf("the size of %s is : %zu\n", #x, sizeof(x)); typedef struct { double a; int x; char c; char *name; } str_ex; typedef enum { MON, TUE, WED, THU, FRI, SAT, SUN } enum_ex; int main(int argc, char *argvc[]) { print_size(int8_t); print_size(int16_t); print_size(int32_t); print_size(int64_t); print_size(uint8_t); print_size(uint16_t); print_size(uint32_t); print_size(char); print_size(short int); print_size(unsigned short int); print_size(unsigned int); print_size(int); print_size(long int); print_size(unsigned long int); print_size(long long int); print_size(unsigned long long int); print_size(signed char); print_size(unsigned char); print_size(float); print_size(double); print_size(long double); print_size(char *); print_size(short int *); print_size(unsigned short int *); print_size(unsigned int *); print_size(int *); print_size(long int *); print_size(unsigned long int *); print_size(long long int *); print_size(unsigned long long int *); print_size(signed char *); print_size(unsigned char *); print_size(float *); print_size(double *); print_size(long double *); print_size(str_ex); print_size(enum_ex); }
标签:good,语言,各种类型,int,unsigned,long,print,include,size From: https://www.cnblogs.com/dogingate/p/17868875.html