With a class"Student" declared as below:
class Student {
public:
int id;
char name[50]; // Data field
int age; // Data field
Student();
Student(int, char*, int);
};
You are required to implement the class functions and also two other functions used to process Student objects, which can get output as specified later.
void set(Student &, int, char*, int);
void print(Student);
1) You don't need to submit the main function.
2) You don't need to include the header file forclass declaration by yourself.
Output
Steven Gates (100) is61 years old.
Larry Jordan (123) is18 years old.
No Name (124) is0 years old.
提示,头文件请包涵如下代码:
#include<iostream>#include<cstring>usingnamespacestd;
class Student
{
public:
int id;
char name[50]; // Data fieldint age; // Data field
Student();
Student(int, char*, int);
//void set(int, char*, int);//void print();
};
voidset(Student &, int, char*, int);
void print(Student);
1348 [BA1000] The Student Class with Public Data Fields
Description With a class "Student" declared as below: class Student {public: int id; char name[50]; // Data field int age; // Data field Student(); Student(int, char*, int);};You are requi