一个C++程序出问题了。。可塑看不懂= =
#include <iostream>
#include <string>
using namespace std;
class student{
public:
student(string id,string name,double score)
{
this->id=id;
this->name=name;
this->score=score;
}
double getscore(){return score;}
void print()
{
cout<<"id is"<<id<<endl;
cout<<"name is"<<name<<endl;
cout<<"score is"<<score<<endl;
}
private:
string id;
string name;
double score;
};
int main(){
student s1("001","小张",85);
student *p;
p=&s1;
if(p->getscore()>=80&&p->getscore()<=90)
{
p->print();
};
return 0;
}
报错的内容看不懂
[解决办法]
student s1("001","小张",85)这条语句有中文标点符号,改过来就好了。
[解决办法]
把错误贴上来,装了Windows8,还没装编译器。
编译不了。