There's always the standard c/c++/java mistake:
Code:
void myfunc(char* p)
{
if (p = NULL)
{
cout << "p is null" << endl;
}
// continue on assuming p isn't NULL
}
}
This is a guaranteed segmentation fault.
There was a movement a while back to write
instead of
since
is NOT syntactically correct, but most (including me) just think it looks odd and hard to read.
Another common mistake:
Code:
if (...);
{
// code
}
or
Code:
while(...);
{
//code
}
This, of course, branches to or loops within a blank line instead of executing the code in the block.
Things like this can be disasterous.