|
From: Ioannis V. <iv...@em...> - 2003-07-15 18:08:49
|
> -----Original Message-----
> From: Ioannis Vranos [mailto:iv...@em...]
> Sent: Tuesday, July 15, 2003 9:00 PM
> To: Dev-C++ Mailing List (dev...@li...)
> Subject: RE: [Dev-C++] STL Map question
>
> if(whatever1[p->first]+whatever2[p->first]+.... == 0)
What I wrote above is not good, it's behaviour is implementation dependent.
The right approach is to check each return value against 0, since they are
pointer values.
So thee above should be:
if(!whatever1[p->first] && !whatever2[p->first] && ... &&
!whatevern[p->first])
{
//....
}
Sorry but apparently the caffeine had not reached my mind yet.
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|