To add to this (okay, so Desolation just pointed this out, some other fact I will point out)...
USE WARNINGS (and a proper compiler).
If you do something like:
Many compilers generate warnings at pedantic level, requesting you to put the expression in parenthesises to indicate it was actually what you wanted.Code:if(something = NULL)