ITPub博客

首页 > 应用开发 > > c++的问题

c++的问题

作者:deeply 时间:2019-08-14 15:01:42 0 删除 编辑

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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: npm 安装jq报错
请登录后发表评论 登录
全部评论

注册时间:2008-05-30

  • 博文量
    215
  • 访问量
    24533