求助:string类型的自动初始化问题
//了解string数组的初始化#include <iostream>
#include <string>
using namespace std;
string sa[10];
int ia[10];
int main()
{
string sa2[10];
int ia2[10];
//cout << "sa[10] = " << sa << endl; //为什么不可以这样输出字符串?
//cout << "sa2[10] = " << sa2 << endl;
for (int i = 0; i != 10; ++i)
{
cout << sa[i] << " ";
}
cout << endl;
for (i = 0; i != 10; ++i)
{
cout << sa2[i] << " ";
}
cout << endl;