Hello, I've recently started programming again after a long intermission of a year or so (Only ever learned basic programming in Visual Basic) But I've decided to start with the ever famous number guessing game to get a base understanding of C++. Right now the program is all in one function (main()) and eventually will go into separate functions and header files. Everything was going fine until I added 'Set your own range of values for random int generation', which is where I have an issue. When the user sets the values, the generator creates a negative number for some reason. Here's the source code:
Welcome to the Number Guessing Game!
Would you like to set the limits? (Y / N)
Y
Set Minimum:
10
Set Maximum:
20
Generating a random number between: 10 and 20
-8
Please enter a valid guess.
So this is where my problem is, if they choose not to pick the range, the numbers default and it works fine. By the way I'm running Xcode on 10.7.4 if that makes a difference. I'm usually on my desktop PC with Visual Studio Express but I'm not at home at the moment. But any help would be great, and Thank You for your time! Oh and sorry if you see some really bad ways to utilize C++, this is my first time programming in a 'real' language.