my aim is that the loop continues until the flag is raised. So when flag=1 this means the flag was raised and the loop should finish. Ill take the 0 out, i agree its misplaced thanks
my aim is that the loop continues until the flag is raised. So when flag=1 this means the flag was raised and the loop should finish. Ill take the 0 out, i agree its misplaced thanks
guessCode:for(flag=0; flag != 1; )
would be better hereCode:flag=0; while( ! flag ){ .... }
Kurt
that seems to have worked much better. Thank you. Its still not functioning perfectly but hopefully i can take it from here. I really appreciate you taking the time to help me, thanks so much
No! You're misusing some basic C syntax:
flag = 1 is an assignment, meaning that you are setting the variable flag to have value 1
flag == 1 is a comparison, meaning that you are testing whether flag and 1 have the same value
So what you're doing is assigning 1 to flag rather than testing whether flag is 1. You should re-read your text book or course notes. This is fundamental stuff.
"No-one else has reported this problem, you're either crazy or a liar" - Dogbert Technical Support
"Have you tried turning it off and on again?" - The IT Crowd