Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ declaration error
#13
Thank you Fiel. Unfortunately, I don't have access to a compiler until tomorrow but from I'm reading, the program starts out asking the user for an upperBound and lowerBound, then the game doesn't actually start until the player enter a number?

I'm also looking at these lines

cout << "Upper Bound?\n";
cin >> upperBound;

If the user were to enter in 0, wouldn't there would be a division by 0 (osh-) when the program reaches the line "guess = lowerBound + (rand() % upperBound);"?
Reply


Messages In This Thread
C++ declaration error - by sky54264 - 2009-09-15, 12:35 PM
C++ declaration error - by Tempus - 2009-09-15, 12:56 PM
C++ declaration error - by Fiel - 2009-09-15, 01:02 PM
C++ declaration error - by sky54264 - 2009-09-15, 01:04 PM
C++ declaration error - by Tempus - 2009-09-15, 02:56 PM
C++ declaration error - by Fiel - 2009-09-15, 08:13 PM
C++ declaration error - by Takebacker - 2009-09-15, 08:35 PM
C++ declaration error - by Russt - 2009-09-15, 08:52 PM
C++ declaration error - by sky54264 - 2009-09-15, 08:56 PM
C++ declaration error - by Russt - 2009-09-15, 09:07 PM
C++ declaration error - by Fiel - 2009-09-15, 09:19 PM
C++ declaration error - by Russt - 2009-09-15, 10:15 PM
C++ declaration error - by sky54264 - 2009-09-15, 11:08 PM
C++ declaration error - by Russt - 2009-09-15, 11:35 PM
C++ declaration error - by Fiel - 2009-09-16, 09:30 AM
C++ declaration error - by sky54264 - 2009-09-16, 07:23 PM
C++ declaration error - by Russt - 2009-09-18, 08:22 PM
C++ declaration error - by Fiel - 2009-09-19, 05:05 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)