Search:

Type: Posts; User: CodeMonkey

Search: Search took 0.02 seconds.

  1. using namespace std; is a nice shorthand, but...

    using namespace std; is a nice shorthand, but generally it's a good habit to fully qualify library stuff, so that there isn't any name-clashing with your code, or with code in some library you're...
  2. All kinds of stuff I missed. There's the...

    All kinds of stuff I missed.

    There's the semicolon, too.


    else (guess == number);
    cout << "You guessed the number!";
    //This code is equivalent to:
    //else {}
    //cout << "You guessed the...
  3. Looks a lot better. For the sake of logic flow,...

    Looks a lot better. For the sake of logic flow, you might consider putting all of the stuff happening in your loop that is after the "break" -- you might consider putting all of that in the "if...
  4. if (choice == 'Y' || 'y') Your attempt at...

    if (choice == 'Y' || 'y')


    Your attempt at using your knowledge of English to say something in C++ is natural and understandable. But in C++, this line is read as "if choice=='Y', or if 'y' is...
Results 1 to 4 of 4