Answer the question
In order to leave comments, you need to log in
Output an array through a class?
I have an array of holidays in the file 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);
#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" };
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question