in C-like languages "==" is the boolean equals operator, "=" is the assignment operator
so
"if (variable1 = variable2)" not only returns true unless variable2 == 0, but it assigns the value of variable2 to variable1 -- a nasty little typo that busts code
"if (var1 == var2)" is the correct syntax
----------
sometimes assignments are wanted in if statements -- for example
if ((pipe = popen(command, "r")) == NULL)
{
//error condition
}
(that's opening a "pipe" which is a communications channel between a program and another program it calls -- this one happens to be read -- say it's a program that parses the output of another program and makes it a more readable format -- that's what you use pipes for)