C语音基础类型

来源:互联网 发布:佰笛手风琴 淘宝 编辑:程序博客网 时间:2024/05/29 14:30
#include <stdio.h>int main() {    printf("sizeof(char)=%lu\n", sizeof(char));    printf("sizeof(unsigned char)=%lu\n", sizeof(unsigned char));    printf("sizeof(signed char)=%lu\n", sizeof(signed char));    printf("sizeof(int)=%lu\n", sizeof(int));    printf("sizeof(unsigned int)=%lu\n", sizeof(unsigned int));    printf("sizeof(short)=%lu\n", sizeof(short));    printf("sizeof(unsigned short)=%lu\n", sizeof(unsigned short));    printf("sizeof(long)=%lu\n", sizeof(long));    printf("sizeof(unsigned long)=%lu\n", sizeof(unsigned long));    printf("sizeof(double)=%lu\n", sizeof(double));    printf("sizeof(float)=%lu\n", sizeof(float));    return 0;

}

运行结果:

sizeof(char)=1sizeof(unsigned char)=1sizeof(signed char)=1sizeof(int)=4sizeof(unsigned int)=4sizeof(short)=2sizeof(unsigned short)=2sizeof(long)=8sizeof(unsigned long)=8sizeof(double)=8sizeof(float)=4

原创粉丝点击