#include <iostream> //import header files including dayType
#include <string>
#include "dayType.h"
usingnamespace std;
int main()
{
dayType myDay("Monday"); //Set myDay to Monday
dayType temp("Sunday"); //Set temp to Sunday
dayType anotherDay("Tuesday"); //Set anotherDay to Tuesday
cout << "My day = "; //Print myDay with the print function
myDay.print();
cout << endl;
//Print the previous day with the prevDay function
cout << "The day before my day = " << myDay.prevDay() << endl;
//Print the next day with the nextDay function
cout << "The day after my day = " << myDay.nextDay() << endl;
//Print temp day with the print function
cout << "Temp day = ";
temp.print();
cout << endl;
//Print the previous day with the prevDay function
cout << "The day before temp day = " << temp.prevDay() << endl;
//Print the next day with the nextDay function
cout << "The day after temp day = " << temp.nextDay() << endl;
//Print the current day of another day with the returnDay function
cout << "The returned day of another day = " << anotherDay.returnDay() << endl;
//Print the day that is a certain specified number of days in the future
//as a parameter with the newDay function
cout << "13 days after another day is a " << anotherDay.newDay(13);
system("PAUSE");
return 0;
}
It wont compile though and I dont know why. Here is the error:
c:\program files\microsoft visual studio 9.0\vc\include\xlocnum(135) : error C2857: '#include' statement specified with the /Ycstdafx.h command-line option was not found in the source file
I'm a UAT student studying for my bachelor's in Computer Science. I copied your files and ran them in my editor (I used NetBeans 7.0) and it ran just fine. I checked the error online and came across this page at MSDN that discussed manually configuring the compiler option in the Visual Studio development environment.
Damita - That link was exactly what I needed. I had to go into both .cpp files and fix the file name of the .h file which was set to the default. Kind of a weird setup but ended up being a VC++ thing. Pretty easy fix in the end. Thanks!