请问为啥建立的对象不能用呢
#include <iostream>using namespace std;
class Student
{public:
void max(Student *arr)
{float max_score=arr[0].score;
int k=0;
for(int i=1;i<5;i++)
if(arr[i].score>max_score) {max_score=arr[i].score;k=i;}
cout<<arr[k].num<<" "<<max_score<<endl;
}
Student(int n,float s):num(n),score(s){}
int num;
float score;
};
void main()
{Student o;这儿出错,错误提示信息:error C2512: 'Student' : no appropriate default constructor available
Student stud[5]={
Student(101,78.5),Student(102,85.5),Student(103,98.5),
Student(104,10.0),Student(105,95.5)};
void max(Student* );
Student *p=&stud[0];
o.max(p);
}