Hello guys.. I'm working on a project. There are 3 classes. Two are inherited from one.
This is the implementation of the main class. There's an error. I have no idea how to debug it.
Would you please check it?!
# include <iostream>
# include <string>
# include "MainMenu.h"
using namespace std;
MainMenu::MainMenu()
{
destanation="no destanation yet.";
departure="no departure yet.";
date="no date entered yet.";
time="no time yet.";
}
MainMenu::MainMenu(string the_name)
{
name="No name yet.";
}
MainMenu::MainMenu(string the_destanation, string the_departure, string the_date, string the_time)
{
destanation=the_destanation;
departure=the_departure;
date=the_date;
time=the_time;
}
ostream& operator << (ostream& outs,const MainMenu& settings)
{
outs<<settings.departure
<<settings.destanation
<<settings.date
<<settings.time;
return outs;
}
istream& operator >> (istream& ins,const MainMenu& settings)
{
ins >>settings.departure
>>settings.destanation;
return ins;
}
void display_main_menu ()
{
cout<<"Hello and welcome to J-Otaku-Air travel agency."<<endl
<<"Please choose a number from the following menu, then press enter to "
<<"move to the desired page."<<endl<<endl
<<"1. About J-Otaku-Air"<<endl
<<"2. Reservations"<<endl
<<"3. Currency Converter"<<endl
<<"4. Budget Travels & Special Offers"<<endl
<<"5. Frequently asked questions"<<endl
<<"6. Contact us"<<endl
<<"* Press 0 to exit"<<endl<<endl;
}
string MainMenu::choose_from_main_menu (string choice)
{
cin>>choice;
return choice;
}
void MainMenu::JOTAKU_LOGO () const
{
cout << "\t\t\t ================= "<<endl;
cout << "\t\t\t || || || || "<<endl;
cout << "\t\t\t || || || || "<<endl;
cout << "\t\t\t || || || "<<endl;
cout << "\t\t\t \\ || || "<<endl;
cout << "\t\t\t \\ || "<<endl;
cout << "\t\t\t \\ || "<<endl;
cout << "\t\t\t \\|| J-Otaku-Air "<<endl;
cout <<endl;
cout <<endl;
}
This is the compilation message.
1>------ Build started: Project: cs102 proj, Configuration: Debug Win32 ------
1>Linking...
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\fofa\Documents\Visual Studio 2005\Projects\cs102 proj\Debug\cs102 proj.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\fofa\Documents\Visual Studio 2005\Projects\cs102 proj\Debug\BuildLog.htm"
1>cs102 proj - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========