I think you still haven't understood that there is a *difference* between assignment and comparison!!Code:0==x; //Sets X=0 meaning the program can continue
I think you still haven't understood that there is a *difference* between assignment and comparison!!Code:0==x; //Sets X=0 meaning the program can continue
"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
Two equals signs, ==, compares two things. All you do with that statement is compare 0 to x, but you don't do anything special depending on whether or not x is zero. That is, you don't make any decisions based on that fact, no if/else, no loops, nothing. That statement by itself does nothing useful, the results of the comparison are immediately discarded*.
One equal sign, =, is used to assign things. If you mean to assign the value 0 to x, you must put x = 0;. The variable you are assigning to goes on the left. What you want to assign to it goes on the right. That can be a number, like 0, and expression like 3 * y + 42, or the result of a function call, among other things.
I think it's time for you to go back and re-read the first few chapters of your C textbook to iron out some of these basics.
* A good compiler will warn you of this. Perhaps you need to turn up the warnings on your compiler, so you will get a warning message like "statement has no effect".