if(!strcmp(username,"raprap321")){
if(!strcmp(password,"qwerty")){
clrscr();
gotoxy(23,14);
printf("Correct");
}
else{
clrsrc();
gotoxy(23,14);
printf("wrong");
}
else{
clrscr();
gotoxy(23,14);
printf("Incorrect");
}
}
im lacking of other codes..
i want an output that uses clrscr which
when you input username and password .
And if its wrong it will never gonna change page....
please help me..Im just a noob.. But my code is correct..
wew i have already answer my question....
i will just a loop.
do while looping.. is cool.
The things must have are
variable=1;means true
variable=0;means false...
in short i just apply this
void main(){
char username[50];
char password[50];
int a;
do{
clrscr();
box(10,15,40,20);
gotoxy(11,14);
printf("username: ");
gotoxy(11,16);
printf("password: ");
gotoxy(22,14);
gets(username);
gotoxy(22,16);
gets(password);
if(!strcmp(username,"raprap321")){
if(!strcmp(password,"qwerty")){
clrscr();
gotoxy(23,14);
printf("Correct");
a=1;
}
else{
clrsrc();
gotoxy(23,14);
printf(" ");
a=0;
}
}
else{
clrscr();
gotoxy(23,14);
printf(" ");
a=0
}
}while(a!=1);
getch();
}
gets() is not a safe function call. It does no bounds checking.