I am simply trying to add some static constant vectors to my date class. Compiler errors given below. Here is my Date.h file.
#include <vector>
#include <string>
class Date {
private:
int month;
int day;
int year;
static const std::vector<std::string> monthNames(13);
static const std::vector<int> daysInMonths(13);
public:
Date();
Date(int month, int day, int year);
}
Now my Date.cpp file
#include "Date.h"
#include <vector>
#include <string>
const std::vector<std::string> Date::monthNames(13) {"","January","February","March","April","May",
"June","July","August","September","October","November","December"};
const std::vector<int> Date::daysInMonths(13) {0,31,28,31,30,31,30,31,31,30,31,30,31};
Date::Date() : month(1), day(1), year(1900){
}
Date::Date(int month, int day, int year) : month(month), day(day), year(year) {
}
My g++ compiler gives me errors I cannot decipher for my declaration of my vectors in the .h file and for the definitions I made in the .cpp file. I cannot get the errors to format well in here. Can someone please show me what I am doing wrong?