• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
5 views
What is "expected unqualified-id" ?
by (1.5k points)  
reshown by

1 Answer

0 votes
I get a mistake "blunder: expected inadequate id before '{' token" on line 6.

Any suggestions please

#include <iostream>

utilizing namespace std;

class Test;

{

open:

void setWord( string word )

{

theWord = word;

}

string getWord()

{

return theWord;

}

void displayWord()

{

cout << "Your pledge is " << getWord() << endl;

}

private:

string theWord;

}

int principle()

{

string aWord;

WordGame theGame;

cin >> aWord;

theGame.setWord(aWord);

theGame.displaymessage();

}

There ought to be no semicolon here:

class Test;

...in any case, there ought to be one toward the finish of your group definition:

...

private:

string theWord;

};/<- - Semicolon ought to
by (8.9k points)  
...