On Tue, 04 Apr 2000, you wrote:
> No, they're exactly the same.



I just recently read a C FAQ that points out that if the right template is in
scope, so that the compiler knows that strcmp returns a char* they are not
merely equivalent but REALLY exactly the same.  Same parse tree is generated,
everything.  There are some interesting subtlties with if(!expr) and  if(expr
== 0) in a pointer context.






 >  > ----- Original Message ----- > From: "Jerry Eckert"
<[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 04, 2000 12:56 PM
> Subject: RE: C question
> 
> 
> > Thanks to everyone for the suggestions for comparing a list of strings.
> For
> > now I think I'll stay with the if..else if.. for simplicity.
> >
> > One more question:
> >
> > To test two strings for equality, is there a difference between
> >
> >     if (strcmp(s1, s2) == 0)
> > and
> >     if (! strcmp(s1, s2))
> >
> > Jerry
> >
> >
> > **********************************************************
> > To unsubscribe from this list, send mail to
> > [EMAIL PROTECTED] with the following text in the
> > *body* (*not* the subject line) of the letter:
> > unsubscribe gnhlug
> > **********************************************************
> >
> 
> 
> **********************************************************
> To unsubscribe from this list, send mail to
> [EMAIL PROTECTED] with the following text in the
> *body* (*not* the subject line) of the letter:
> unsubscribe gnhlug
> **********************************************************
--
email me at  [EMAIL PROTECTED]
"Somebody once told me that in basketball you can't hold the ball and run.  
I got a basketball and tried it and it worked just fine.  He obviously didn't 
understand basketball." Attributed to Roger Miller.

**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to