Problems with integers

This is going to sound stupid since the answer is probably in front of my eyes, but I'm currently making a text based game and my compiler keeps giving me to messages both for line 2 for you guys. " Expected ';' before "int"" and the other message is "expected primary-expression before "int""
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 int ship_name;
	;int menu_choice()
	{


		cout << "1-New Game/n";
		cout << "2-Load Game/n/n";

		cout << "Choose a option:/n";

		cin >> menu_choice;
		if (menu_choice == "New Game/n")
		{
			cout << "\nLoading...";

Could I get some help please?
there are some syntax error in this code

1
2
3
int ship_name;
	int menu_choice()//no semicolon before
	{...


hope it helps
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>

int main()
{
    int menu_choice; // ()

    std::cout << "1-New Game\n"
              << "2-Load Game\n\n"
              << "Choose an option (1/2): ";

    std::cin >> menu_choice;
    if (menu_choice == 1 )
    {
       std::cout << "\nLoading...";
       // ...
    }

    // ...
}

Topic archived. No new replies allowed.