sizeof'A'的价值是多少?

时间:2013-11-21 01:50:46

标签: c sizeof

//a.c
#include<stdio.h>
int main()
{
    printf("%d \n",sizeof'A');   //the result is 4
    return 0;
}

为什么sizeof'A'的结果在c中是4?我在Windows 7 X64,vs2010中运行它。

//a.cpp
#include<stdio.h>
int main()
{
    printf("%d \n",sizeof'A');   //the result is 1
    return 0;
}

在.cpp文件中,rusult是1.why?

0 个答案:

没有答案
相关问题