|
#include "stdafx.h"
#include "iostream.h"
class student
{
friend ostream & operator<<(ostream &,const student & );
friend istream & operator>>(istream & ,student & );
public:
student(student &);
student(int,string,string);
int getAge();
string getName();
string getClassName();
void setAge(int);
void setName(string);
void setClassName(string);
virtual ~student();
private:
int age;
string name;
string className;
};
student::student(student &stu)
{
this->age = stu.age;
this->className = stu.className;
this->name = stu.name;
}
student::student(int age,string name,string className)
{
this->age = age;
this->name = name;
this->className = className;
}
int student::getAge(){
return this->age;
}
string student::getName(){
return this->name;
} |
|