Quote:
Originally Posted by zero2
![Thumbs Up](/tfp/images/smilies/thumbsup.gif) It now works after Jinnkai's suggestion of each variable having it's own line. That's really weird because normally it works, maybe the compiler didn't like it this time, since I had so many variables on one line.
|
A lot of compilers will sometimes (in debug mode) initialize variables to reasonable values.. what you did at the top:
double var1, var2, var3 = 0;
is initializing ONLY var3. Sometimes you can get lucky and var1 and var2 will be 0. the correct line would be:
double var1=0, var2 = 0, var3 = 0;