need a protected class made to access month day year I understand you need to create a class from the inherited class and not call the protected data in main
#include <iostream>
#include <fstream>
using namespace std;
class dateType
{
public:
dateType();
dateType(int, int, int);
void setDate(int, int, int);
void printDate(ostream&)const;
protected:
int month;
int day;
int year;
};
ostream& operator<<(ostream &os, const dateType &d) {
os << d.month << "/" << d.day << "/" << d.year;
files
return os;
}
when this code executes I get an error saying month, day and year are protected