int main()
{
char q;
int month;
int year;
int SENTINEL = -9999;
int userSent = 0;
while (userSent != SENTINEL)
{
cout << "Please enter a month: ";
cin >> month;
cout << "\n";
cout << "Please enter a year: ";
cin >> year;
cout << "\n";
calendarType cal(month, year); //for 2014, first day for each month,
//6 is sunday
//9 is monday
//4 tuesday
//10 wednesday
//5 is thursday
//8 is friday
//11 is saturday
cal.printCalendar();
cout << "If you would like to continue, type 0 and hit enter. " << "\n" << "If you would like to quit, type -9999 and hit enter. ";
cin >> userSent;
cout << "\n";
class calendarType
{
public:
void setMonth(int m);
void setYear(int y);
int getMonth();
int getYear();
void printCalendar();
calendarType();
calendarType(int m, int y);
private:
// Note that member functions can also be private which means only functions
// within this class can call them.
dayType firstDayOfMonth();
void printTitle();
void printDates();
// Composition rather than inheritance, although firstDate is a derived class
// from the base class dateType.
extDateType firstDate;
dayType firstDay;
};
#endif
*****************dateType.h******************
#ifndef dateType_H
#define dateType_H
class dateType
{
public:
void setDate(int, int, int);
void setMonth(int);
void setDay(int);
void setYear(int);
int getMonth() const;
int getDay() const;
int getYear() const;
void print() const;
int getDaysInMonth();
int numberOfDaysPassed();
int numberOfDaysLeft();
void incrementDate(int nDays);
bool isLeapYear();
dateType(int = 1, int = 1, int = 1900);
private:
int dMonth;
int dDay;
int dYear;
};
#endif
welcome! This is too much to read without any formatting. Edit your post and put in code tags, the <> on the side bar editor or the word code in [] brackes and [/] to end the code block.
also, describe what it should do and what it does wrong. "this giant block of random code does not work" is not helpful. "this crashes when I type in blah" or "this says 23 and should say 42" would tell us a lot more
@jonin and @Furry Guy: The OP did state his issue:
1>calendarType.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
1>calendarType.obj : error LNK2019: unresolved external symbol "public:
1>calendarType.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > * dayType::weekDays"
@OP: The linker is telling you that it can't find certain symbols when it tries to link your program. The linker errors are coming from calendarType.obj, however you did not provide the source for calendarType.cpp so we can't reproduce your problem.
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.