请问一下这里为什么报错了?
#include <iostream>
using namespace std;
#include <string>
int main()
{
//C style
char str1[] = "hello world";
//C++ style
string str2 = "hello world";
cout << "str1=" << str1 << endl;
cout << "str1空间是" << sizeof(str1) << endl;
cout << "str1 ACSII码是" << (int)str1 << endl;
cout << "str2空间是" << sizeof(str2) << endl;
cout << "str2 ACSII码是" << (int)str2 << endl; //这个地方报错,为什么?
cout << "str2=" << str2 << endl;
system("pause");
return 0;
}