摘要:
一、char str[] = "abcd";
cout<<sizeof(str)<<endl;
//答案:5。因为有一个'\0' wchar_t wstr[] = "abcd";
cout<<sizeof(wstr)<<endl;
//答案:10。因为在wchar_t中,'\0'也是两个字节。在linux的g++编译环境中不能使用wchar_t,原因未知 char *p = "abcd";
cout<<sizeof(p)<<endl 阅读全文
posted @ 2012-04-16 22:06
windmissing
阅读(196)
评论(0)
推荐(0)

浙公网安备 33010602011771号