Quote:
|
Originally Posted by chakorules
Burns me ALL this time....don't forget to use DOUBLE equal signs....
|
This is why I always write the constant first, when comparing equality between a constant and a variable:
Code:
if (1 == variable)
{
/* do something */
}
Then if I inadvertently use an assignment rather than a comparison, it's a compile-time error (can't assign a value to a constant).