摘要:
sizeof考虑“\0”,strlen不考虑“\0”#include<stdio.h>#include<iostream>#include<string.h>using namespace std;int main(){ enum m{a,b,c,d,e,f,g,h,i,j,k,l}; cout << sizeof(m) <<endl;//4 枚举类型类似于指针 cout << sizeof("\0\0\0") <<endl;//4 3个\0 + 末尾的\0 = 4 cout << 阅读全文
posted @ 2013-05-04 22:35
T000ny
阅读(236)
评论(0)
推荐(0)
浙公网安备 33010602011771号