变量类型 | 字节数 |
---|---|
短整型 | 2 |
整形 | 4 |
长整型 | 4 |
单精度浮点型 | 4 |
双精度浮点型 | 8 |
字符类型 | 1 |
#include<stdio.h>
int main()
{
printf("%d\n", sizeof(char));
printf("%d\n", sizeof(short));
printf("%d\n", sizeof(int));
printf("%d\n", sizeof(long));
printf("%d\n", sizeof(float));
printf("%d\n", sizeof(double));
}
strlen函数在头文件#include<string.h>中
#include<stdio.h>
#include<string.h>
int main()
{
char arr[] = "asfdgng";
printf("%d\n",strlen(arr));
原文:https://www.cnblogs.com/jiabaolu/p/14769963.html