int login_user()
{
wrong:
printf("-------------Login-------------\n");
int loop,dev;
char usernmcmpr[30],pswdcmpr[4],loginchoice,test[30];
printf("Username:");
scanf(" %s",&usernmcmpr);
printf("Password:");
scanf(" %s", &pswdcmpr);
printf("1. %s\n",username);
printf("2. %s",usernmcmpr);
if(strcmp(password,pswdcmpr) == 0 && strcmp(username,usernmcmpr) == 0)
{
system("cls");
printf("-------------Main Menu-------------\n");
printf("a.Calculate Cost\nb.Payment\nc.Recepit\nd.Exit\n");
scanf(" %c", &loginchoice);
if (loginchoice == 'a')
{
system("cls");
calculate_cost();
}
else if (loginchoice == 'b')
{
system("cls");
payment();
}
else if (loginchoice == 'c')
{
system("cls");
receipt();
}
else if (loginchoice == 'd')
{
keep_Looping = 1;
system("cls");
}
else
{
system("cls");
printf("-------------Error-------------\n");
printf("Invalid input please try again\n");
goto wrong;
clear();
}
}
else
{
goto wrong;
}
return 0;
}
It used to work and then all of a sudden it stopped, don't know why i didn't even change the code in this function nor did i change anything related to it. Really can't tell what is wrong.