SOS me with my Log in Dialog

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..

I don't see what your problem is?

You've not posted the code correctly in an indented and formatted manner. If you had done that when you'd have an easier time to see whats wrong.

I'd also suggest something like: if ( (username == "etc") && (password == "etc") ) instead of nested if statements.

http://www.cplusplus.com/forum/articles/1624/
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.
Topic archived. No new replies allowed.