J
Julie
JKop said:Rolf Magnus posted:
LMAO!!!
This conversation is so stupid!!!
if (number != 0) //This is pidgeon C++
if (number) //This is proper!
Similarly:
void Grent(unsigned int* pK)
{
if (!pK) throw "ahhh!!!!!";
}
Who said anything about proper? For such a stupid thread, you are now below
it...
if (ptr != 0) //correct, intent not immediately clear
if (*ptr != 0) // intent clear
if (ptr != NULL) // correct, intent is clear
if (ptr) // correct, intent not immediately clear
if (*ptr) // intent clear
For most, this will come down to an issue of style, to others (including me),
an issue of self-documenting code. There is no right answer the way the
language is currently defined and implemented.