SO MY PROB HERE IS JUST PLAINLY THE BACKSAPCE FEATURE OF MY PROGRAM EVERYTHING WORKS FINE EXCEPT FOR THE FACT THAT THE PROGRQAM IS CONSIDERING THE BACKSPACE KEHY AS PART OF THE CHARACTERS.
int verification2()
{
system("cls");
char userChar[100], choice = 'Y', input, passChar[100];
for (int i = 0; i < 100; userChar[i++] = 0);
while (choice == 'Y')
{
//system("cls");
gotoxy(28, 10);
cout << "ENTER USERNAME: ";
cin.getline(userChar, 100);
//system("cls");
gotoxy(28, 12);
cout << "ENTER PASSWORD: ";
for (int i = 0;; i++)
{
input = _getch();
if ((input != 8) && (input != 13))
{
passChar[i] = input;
}
else if (input == 8)
{
cout << "\b \b";
passChar[i] - 1;
}
else if (input == 13)
break;
//system("cls");
gotoxy(28, 12);
cout << "ENTER PASSWORD: ";
for (int j = 0; j < i + 1; j++)
cout << "*";
}
cout << endl;
if (!strcmp(userChar, "veronica"))
{
Sleep(1000);
gotoxy(28, 14);
cout << "UserName correct!n" << endl;
}
else
Sleep(1000);
gotoxy(28, 14);
cout << "Username incorrect!n";
if (!strcmp(passChar, "password"))
{
Sleep(1000);
gotoxy(28, 16);
cout << "Password correct!n" << endl;
}
else
Sleep(1000);
gotoxy(28, 16);
cout << "Password incorrect!n";
if ((!strcmp(userChar, "veronica")) && (!strcmp(passChar, "password")))
{
Sleep(1000);
gotoxy(28, 18);
cout << "Access Granted!";
Sleep(1000);
return 0;
}
else
Sleep(1000);
gotoxy(28, 18);
cout << "Acess denied!n";
Sleep(1000);
gotoxy(28, 19);
//cout << "Do you want to try again? Y/N : ";
//cin >> choice;
//choice = toupper(choice);
//cin.ignore(100, 'n');
for (int i = 0; i < 100; userChar[i++] = 0);
for (int i = 0; i < 100; passChar[i++] = 0);
}
return 0;
}