Hello.
I am just getting in to this language, and in the context of that I have started my biggest project to date.
Iam making a program where you can enter the rates which you think different games deserve at different areas. Everything is looking ok until I start compiling. My compiler says that there are something wrong with "++count;". I hope someone can help me. ;D
If I remove the "++count;"- line the program wont complete. It just freezes after I have entered all the rates, without showing the final result. Same happens if I remove line 54.
rej3kt: The program compiled as it should after I put in the int "int count =0", even though it wont write the final result
As bazzy stated the variable x is unintialized, meaning that it will contain some garbage value, and as long as that value is something other than zero the loop will run. Since the value of x isn't changed you'll end up with an infinite loop. Another problem with this while loop is that every time it runs the value for the variable count is re-intialized to zero again. Meaning that ++count isn't ever being incremented past one and the variable count is pointlessly being toggled back and forth from zero to one and back to zero over and over again. Placing the declaration and intializtion of the variable count prior to the while loop will solve the latter problem.
That is because the condition of the loop will never be false, it is an uninitialized variable which never gets a value...is it right
[url=http://www.DigBands.com/store]DigBands[/url]