У меня есть массив праздников в файле Holidays.h
#pragma once
#include "Month.h"
struct Holiday {
const char name[25];
Month month;
int day;
};
Holiday holidays[] = {
{"New Year",Month::JAN,1},{"Orthodox Christmas",Month::JAN,7},{"Women's Day",Month::MAR,8},
{"Labor Day",Month::MAY,1},{"Victory Day",Month::MAY,9},{"Independence Day",Month::JUL,3},
{"October Revolution Day",Month::NOV,7},{"Catholic Christmas",Month::DEC,25},{"Orthodoxy Easter",Month::DEC,25},
{"Catholic Easter",Month::DEC, 25},{"Radonitsa",Month::DEC,25}
};
int amountOfHolidays = sizeof(holidays) / sizeof(*holidays);
и файл Month.h :
#include <string>
enum class Month{ JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC};
const int MONTHCOUNT = static_cast<int>(Month::DEC) - static_cast<int>(Month::JAN) + 1;
const std::string monthString[MONTHCOUNT] = {"january", "february", "march", "april", "may", "june",
"july", "august", "september", "november", "december" };
Как можно вывести все праздники используя класс?