Mail Archives: djgpp/1998/03/01/15:30:58
shifter wrote in message <34F79C17 DOT 71DC AT sainet DOT net>...
>#include <stdio.h>
>
>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);
the function gets returns address of i, not the string i. I'm not really up
on my strings either, but perhaps
while(strcmp(gets(i),password) !=0)
would work instead.
> 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 <shifter AT sainet DOT net>
- Raw text -