iccaros Posted May 15, 2005 Report Share Posted May 15, 2005 agin c++what is wrong with this if statment, I have an array I an testing aginsta range of number to createa poll of how many fit in the range. there are 9 ranges.for (int x = 0; x <=9; x++);{if ( a >= salary[x] && a <= salary[x] + 99) {Polldata[x] += 1;}} Quote Link to post Share on other sites
shanenin Posted May 15, 2005 Report Share Posted May 15, 2005 (edited) for (int x = 0; x <=9; x++);do you need a space after <=I am sure that is not a problem(probably just a typo), it was the only thing I noticed, maybe someone else has a real answer. Edited May 15, 2005 by shanenin Quote Link to post Share on other sites
iccaros Posted May 15, 2005 Author Report Share Posted May 15, 2005 thanks for the input.. but in C++ spaces don't mean anything.but it must be a syntex error of some type that is causing the problem. Quote Link to post Share on other sites
jcl Posted May 15, 2005 Report Share Posted May 15, 2005 for (int x = 0; x <=9; x++); <--- stray semicolon Quote Link to post Share on other sites
iccaros Posted May 15, 2005 Author Report Share Posted May 15, 2005 hmmm.. this seams to be a pattern with me.. thanks, I'll past a note to my conmputer to check for the stray semicolon.. as I was not looking for that Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.