error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'

#include "student.h"
#include <string>
#include <iostream>
using namespace std;

student::student(int n,char s,datetime date,int i,string c,int g): person(n,s,date,i), course(c), performance(g)
{
}

void student::GetScore()
{
cout<<person.show<<endl;
}

void student::GetCourseName()
{
cout<<course<<performance<<endl;
}

student::~student(void)
{
}

这一句报错了:cout<<course<<performance<<endl;
怎么改?

第1个回答  2012-04-30
this.course course是个成员,要指定对象才行追问

这里this指针是可以省略的。。

相关了解……

你可能感兴趣的内容

大家正在搜

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网