Date: Tue, 3 Mar 1998 05:16:56 -0500 (EST) Message-Id: <199803031016.FAA26108@p2.acadia.net> To: shifter Subject: Re: why don't this work Cc: djgpp AT delorie DOT com References: <34F79C17 DOT 71DC AT sainet DOT net> in-reply-to: <34F79C17.71DC@sainet.net> From: swarnerx3 AT acadia DOT net (Scott Warner) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Precedence: bulk Doesn't work because you're comparing pointers, not contents of. You need to use the strcmp() function, ie, while(strcmp(gets(i),password)) Hm... You may also have a buffer problem just declaring i and password as char pointers, but maybe not. In message <34F79C17 DOT 71DC AT sainet DOT net>, shifter wrote: > #include > > main() > { > char *i; > char *password; > > clrscr(); > printf ("Input a password:"); > gets(password); > printf("you typed:%s\n",password); > do{ > printf ("Input a password:%s:",i); > }while (gets(i) != password); > printf("you got it!!!"); > exit(0); > } > > i'm trying to get it to break out of loop with the correct password > what am i doing wrong? > ralph >