View Single Post
  #7   Spotlight this post!  
Unread 27-01-2005, 00:11
Workaphobia Workaphobia is offline
Registered User
AKA: Jon
FRC #1546 (Chaos Inc.)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Long Island
Posts: 26
Workaphobia will become famous soon enough
Re: Weird problem with if statements

That sort of makes sense. After all, jdong shows how it can be represented with operator overloads and reference returns, yet C doesn't allow reference types. Just shows how easy it is to take C++ for granted.

By the way, I remember reading somewhere that NULL (or any literal '0', since NULL is a macro) is not guaranteed to evaluate to 'false' for all implementations. This means that you may not get the result you expect when you do "if(ptr)" to test if a pointer is safe to dereference. Or maybe I have it reversed, and it's something related that isn't guaranteed... Oh well, just be careful with your if conditions.