本人刚学c++,就遇到这个问题,哪位高手有时间看一下,帮一下小妹吗?
#include "stdafx.h"
#include <string.h>
#include <iostream.h>
//using namespace std;
int main()
{
string name;
cout << "Enter name:";
getline(cin,name);
cout << name;
printf("Hello World!/n");
return 0;
}
编译后出现:
E:/kkk/kkk.cpp(12) : error C2065: 'string' : undeclared identifier
E:/kkk/kkk.cpp(12) : error C2146: syntax error : missing ';' before identifier 'name'
E:/kkk/kkk.cpp(12) : error C2065: 'name' : undeclared identifier
E:/kkk/kkk.cpp(14) : error C2065: 'getline' : undeclared identifier
Error executing cl.exe
谢谢