write implementation for the following functions (you can call other functions from these classes if you want assuming that they are implemented): ~Person(); Person& Person::operator=(const Person& p); Student(const Student&);
This is C++ Programming
Given the following classes:
#include <iostream>
class Person
{
char* name;
public:
Person();
Person(const char*);
void setName(const char* nm);
void display(std::ostream&) const;
Person(const Person&); // copy constructor
Person& operator=(const Person& src); // copy assignment
~Person();
};
class Student : public Person
{
int no;
float* grade;
int ng;
void init(int, int, const float*);
public:
Student();
Student(int);
Student(const char*, int, const float*, int);
Student(const Student&); // copy constructor
Student& operator=(const Student& src); // copy assignment
~Student();
void display(std::ostream&) const;
};
write implementation for the following functions (you can call other functions from these classes if you want assuming that they are implemented):
~Person();
Person& Person::operator=(const Person& p);
Student(const Student&);
Trending now
This is a popular solution!
Step by step
Solved in 4 steps