| www.delorie.com/archives/browse.cgi | search |
| From: | Vic <tudor AT cam DOT org> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: A DOUBT LOOK THIS |
| Date: | Thu, 30 Jul 1998 09:31:19 -0400 |
| Organization: | Communications Accessibles Montreal, Quebec Canada |
| Lines: | 17 |
| Message-ID: | <35C075A7.5CCA@cam.org> |
| References: | <35BFFED0 DOT 459E AT hotmail DOT com> <35C0098B DOT 6835A285 AT mailexcite DOT com> |
| NNTP-Posting-Host: | dialup-678.hip.cam.org |
| Mime-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Doug Gale wrote:
> if (strcmp(argv[1], "the") == 0)
> printf("OK");
> else
> printf("Wrong");
shouldn't this be
if (!strcmp(argv[1], "the") == 0)
^^^
printf("OK");
else
printf("Wrong");
?
AFAIK strcmp returns 0 if there is a match.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |