include "stdafx.h"
include <iostream>
using namespace std;
class student
{
public:
student(int m, int n) :number(m), score(n) {}
int number;
int score;
};
void main()
{
student stu[5] = {
student(1001,85), //调用第一个元素的构造函数student,向它提供两个实参
student(1002,90), //the principle is same as above
student(1003,76),
student(1004,89),
student(1005,76)
}; //定义对象数组
studentp = stu;
void max(student
);
max(p);
}
void max(student*a)
{
int max_score = a[0].score;
int k = 0;
for (int i = 1; i < 5; i++)
if (max_score
{
max_score = a[0].score; k = i;
}
cout <
}
那位能解释一下max(p)什么意思吗?作用是什么?
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1978/viewspace-3170415/ ,如需转载,请注明出处,否则将追究法律责任。