-------------------Code: HelloFunc.cpp-------------------
#include <iostream>
using namespace std;
//Function prototype
void ShowData(string strName,int nAge);
int main()
{
ShowData("Yoshimari",39);
return 0;
}
void ShowData(string strName,int nAge)
{
cout<<"Name:"<<strName<< endl;
cout<<"Age :"<<nAge<< endl;
}--------------------Configuration: Hello - Win32 Debug--------------------
Compiling...
Hello3.cpp
E:\Work\My VC++ Project\Hello\Hello3.cpp(12) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptab
le conversion)
Error executing cl.exe.Hello.exe - 1 error(s), 0 warning(s)以上是我编写的小程序,但是不知道为什么总是报错,还请哪位大虾不吝赐教?