#include "person.h"
#ifndef instructor_h
#define instructor_h
class instructor: public person {
private:
int children;
int salary;
string maritalStatus;
public:
instructor();
instructor(string, string, string, int , int ,string);
instructor operator++();
void print();
int calcSalary();
int getSalary();
int getNumOfChildren();
string getMarialStatus();
friend ostream &operator
Подробнее здесь: [url]https://stackoverflow.com/questions/35904143/friend-not-allowed-outside-of-a-class-definition[/url]
Я пытаюсь перегрузить оператор cout в задании, и меня заставили и попросили разделить мой класс на ([code].h[/code] и .cpp). Вот мой полный код: [h4][code]instructor.h[/code][/h4] [code]#include "person.h" #ifndef instructor_h #define instructor_h class instructor: public person {
private: int children; int salary; string maritalStatus;
public:
instructor(); instructor(string, string, string, int , int ,string);
instructor operator++();
void print();
int calcSalary();
int getSalary(); int getNumOfChildren(); string getMarialStatus();