提示:string 不是一个类型名
#include <iostream>
#include <string>
using namespace std;
int main()
{
string temp = "fdsafdas";
cout < < temp < < endl;
}
注意头文件以及命名空间。