Help with cin

Pages: 12
closed account (jwkNwA7f)
FredBill30 got it fixed 3 posts up.

Sorry, I couldn't help :(
closed account (N36fSL3A)
Though personally I'd do this:
1
2
3
4
5
6
7
    if (choice == 'y' || choice == 'Y')
    {
        x = true;
    }
    else if (choice == 'n' || choice == 'N')
        x = false;
    }


In case you have a user that's feeling like a rebel.(Not wanting to input lowercase)
Last edited on by Fredbill30
closed account (jwkNwA7f)
FredBill30 wrote:
Though personally I'd do this:

if (choice == 'y' || choice == 'Y')
{
x = true;
}
else if (choice == 'n' || choice == 'N')
x = false;
}


I think that is a good idea too.
Thanks so much, everyone! It's really exciting to start getting into writing programs like this and seeing them work.
closed account (jwkNwA7f)
No problem.

daviddet wrote:
It's really exciting to start getting into writing programs like this and seeing them work.

I know. I remember the first time I made a program that worked.
closed account (N36fSL3A)
Ha, yea. Soon it starts to get addictive. :)
closed account (jwkNwA7f)
FredBill30 wrote:
Ha, yea. Soon it starts to get addictive. :)


I know. I made my first program June 3, 2012 (I checked the date the file was created) haven't quit since. :D
Topic archived. No new replies allowed.
Pages: 12