Quote (killg0re @ Nov 4 2014 04:01pm)
The syntax was incorrect, but it didn't break, it only warned that it was incorrect.
There was definitely a logical error, for one she tried to use assignment where it doesn't belong, but that is also a problem of syntax.
You're taking things too literally here, the syntax is incorrect, or there wouldn't be a warning to use the correct operator.
Should just give up here.
Its syntactically correct, you can make assignments inside if statements all you want. The logic however is incorrect. Thus why it would throw a warning. Syntax != warnings.
Example:
Code
if(justStop = right now()) {
Printf("just stop right now \n");
}
Another example:
Code
if((justStop = right now()) && strstr(just stop, "right meow")) {
Printf("just stop right now \n");
}
I use assignments in if statements all the time if I know I need to use it in the logic inside the if statement.
A more practical example:
Code
if((justStop = right now()) != NULL) {
Printf("just stop %s\n", justStop);
}
This post was edited by AbDuCt on Nov 4 2014 02:51pm