1 char a[] = { 'c','+','+' }; 2 char c[] = "c++"; 3 cout << strlen(a) << endl; 4 cout << strlen(c) << endl; 5 cout << sizeof(a) << endl; 6 cout << sizeof(c) << endl;
运行结果:
随机数
3
3
4
随机数产生的原因:
标签:cout,C++,char,随机数,sizeof,strlen From: https://www.cnblogs.com/jiayu-code/p/16739377.html