69,371
社区成员
发帖
与我相关
我的任务
分享
static char temp[10] = {"1234"};
printf("sizeof=%d\n",sizeof(temp));
strtuc AA
{
int a;
int b;
static int c;
}aa;
struct AA
{
int a;
int b;
static int c;
};
string strArr1[] = {"Trend", "Micro", "Soft"};
//书上说sizeof (strArr1) == 12; 明明应该是3 * sizeof(string); string是一个类,并不是指针类型
//居然能举出这样的例子:
int ss[100] = "0123456789";
int main()
{
struct AA
{
int a;
int b;
static int c;
}aa;
int AA::c = 0;
cout<<sizeof(AA)<<endl;
cout<<sizeof (array)<<endl;
//cout<<sizeof (extern_array)<<endl;//sizeof不能计算外部数组的大小,因为外部数组声明时可以不声明其大小
system("pause");
return 0;
}