#include <iostream>
usingnamespace std;
int main()
{
int title;
loop:
cout << "Welcome to Text world" << endl;
cout << "Press 1 to start or 2 for help \n";
cin >> title;
if
(title == 1)
cout << "loading..." << endl;
elseif
(title == 2) {
cout << "Help...." << endl;
help();
}
else
{
cout << "Invalid selection, please try again...." << endl;
goto loop;
}
return 0;
}
and help function signature is incorrect, this will NOT compile:
1 2 3 4 5 6 7
int help()
{
cout << "Welcome to help, this screen shows the basic conceps of the game..." endl;
}
Either change it or return an int:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
int help()
{
cout << "Welcome to help, this screen shows the basic conceps of the game..." << endl;
return 0;
}
// or like this:
void help()
{
cout << "Welcome to help, this screen shows the basic conceps of the game..." << endl;
}