If Statments Help


Recommended Posts

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;

}

}

Link to post
Share on other sites

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 by shanenin
Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...