|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
|||
|
|||
|
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. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Problem: Extremely Frustrating | chantilly_team | Programming | 19 | 12-02-2005 23:00 |
| Physics Problem | Venkatesh | Math and Science | 13 | 30-11-2004 20:30 |
| Weird Output from Dashboard Port | Ian W. | Programming | 9 | 06-03-2004 21:33 |
| The problem with scouting... | archiver | 2001 | 10 | 23-06-2002 23:49 |
| Major problem with chipphua motors | aka Scott White | Motors | 18 | 19-03-2002 19:44 |