header response needed fast

help my code is not loading right i am getting wierd errors. This is my code and it tells me that } on main is a syntax error.

MAIN
#include "menu.h"
#include "hangmanMenu.h"
#include <iostream>

using namespace std;

int main()
{
int x;
hangmanMenu ch;
// menu
char l;

do while (x != 9)
{
cout<<endl;
cout<< "Please select an option below:"<<endl;
cout<< "1. Play Hangman game"<<endl;
cout<< "2. Edit Hangman game"<<endl;
cout<< "9. Exit game"<<endl;
cin >> x;
ch.choice(x);
}//end do while loop
}//end main

MENU.H

#ifndef MENU_H
#define MENU_H
#include <iostream>
#include <string>

using namespace std;

class menu
{
public:
void game();
void words();

private:
string word;

protected:
void guess();

};//end class
#endif

HANGMANMENU.H

#ifndef HANGMANMENU_H
#define HANGMANMENU_H
#include "menu.h"
#include <iostream>

using namespace std;

class hangmanMenu : public menu
{
public:
hangmanMenu(); //default constructor
hangmanMenu(int ch);
void choice(int);
private:
int ch;
int c;
};//end class
#endif

MENU.CPP

#include "menu.h"
#include <iostream>
#include <string>

using namespace std;

void menu::game()
{
cout<< "main option menu for playing the game. "
<< "In menu public."<<endl
<< "Please enter a letter: "<< endl;
menu::guess();
}
void menu::words()
{
word = "Word list - In menu private";
}
void menu::guess()
{
cout << "Function that will check to see if the letter you guess"
<< " is in the word you are trying to find." <<endl
<< "In menu protected";
}

HANGMANMENU.CPP

#include "hangmanMenu.h"
#include "menu.h"
#include <iostream>

using namespace std;


void hangmanMenu::choice(int c)
{
if (c = 1)
return menu::game();
else if (c = 2)
return menu::words();
else
cout << "Please enter a valid option";
}
hangmanMenu::hangmanMenu()
{
c=3;
}
hangmanMenu::hangmanMenu(int ch)
{
choice(ch);
}

The syntax for a do loop is:

1
2
3
do {
//stuff
} while (/*cond*/);
oh crap lol thanks im new at this
thanks that fixed my code you rock Firedraco
No problem, we all were new at some point :)
Topic archived. No new replies allowed.