This is an EXCELLENT idea. Thanks for sharing this.
Quote:
|
Originally Posted by tpc
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).
|