0

Basically im very new at C++ and im having trouble with this, this error keep popping up, any suggestions? Thanks

#include "stdafx.h"
#include <iostream>
#include <string>
#include <ctime>

using namespace std;

string menu();
{                   //this is where the problem is
    string sSel;

    do
    {
        cout << "Guess my Number Game\n\n";
        cout << "A) 1 - 10\n";
        cout << "B) 1 - 100\n";
        cout << "C) 1 - 1000\n";
        cout << "Please make a Selection: ";

        cin >> sSel;
        cin.clear();
        cin.ignore(numeric_limits<streamsize>::max(), '\n');

        sSel[0] = toupper(sSel[0]);

        system("CLS");

    }while(sSel! = "A" && sSel! = "B" && sSel! = "C");
    return sSel;
}
int main()
{
    string sGame;

    sGame = menu();

    system("PAUSE");
    return 0;
}
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by dazexo
0

Line 8. string menu(); ' ; ' shouldn't be there.
Line 28. sSel is type string, so it cant't be compared with "A". Make sSel char array or use some other condition there.

0

Thanks, i realised what i had done after i posted this, thank you for the reply.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.