Message-ID: <199808011034540560.0020E8AA@pogwizd.tcs.uni.wroc.pl> In-Reply-To: <35BFFED0.459E@hotmail.com> References: <35BFFED0 DOT 459E AT hotmail DOT com> Date: Sat, 01 Aug 1998 10:34:54 +0200 From: "Pawel Kowalski" To: a_azevedo AT hotmail DOT com, djgpp AT delorie DOT com Subject: Re: A DOUBT LOOK THIS Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Precedence: bulk *********** REPLY SEPARATOR *********** On 98-08-01, at 02:52, A.S.A. Inc. wrote: >GIVE ME YOUR HELP!!!! > > >What's Wrong???? > > >main(int argc,char *argv[]) >{ >ScreenClear(); >puts(argv[1]); > >if (argv[1]=='the') printf("OK"); ----> Problens with IF >else printf("Wrong"); > >getchar(); >exit(0); >} if (argv[1]=='the') printf("OK"); 1. 'the' is not a string. It's an integer multi-character constant. Should be "the". 2. This lines compares not the strings, but pointers to them. This should work. main(int argc,char *argv[]) { ScreenClear(); puts(argv[1]); if (strcmp(argv[1], "the")==0) printf("OK"); else printf("Wrong"); getchar(); exit(0); } Pawel Kowalski