[Solved] C++ : error with total+= in a while loop
I can see a couple of errors in your code. First, as Pete Becker noted (and Lightness Races in Orbit refined), total isn’t initialized, so its value is indeterminate. It could even be an invalid representation of a floating point number (e.g. a NaN ) and it isn’t for sure a valid starting point for … Read more