小编shi*_*ivi的帖子

C:sizeof()相关的疑惑?

#include <stdio.h>
#include <string.h>

main()
{    
   printf("%d \n ",sizeof(' '));
   printf("%d ",sizeof(""));
}
Run Code Online (Sandbox Code Playgroud)

输出:

4
1
Run Code Online (Sandbox Code Playgroud)

为什么o/p为第一个printf而来4,而且如果我给它''它显示错误为错误:空字符常量但是双引号空白即没有任何空格是没有错误没有错误?

c sizeof

6
推荐指数
3
解决办法
231
查看次数

标签 统计

c ×1

sizeof ×1