ok..... iam working on password protection for my program but i have some little problems here...
here is my code:::::
[cpp]cout << "PASSWORD: ";
getline (cin,password);
if (password == "my pass")
{
menu();
cout << "Your Choice: ";
cin >> chose;
if (chose == '1')
{
menu2();
}
else
if (chose == '2')
menu3();
}
else
for (i=0; i<=5; i++)
{
cout<<"WRONG PASSWORD!!"<<endl;
cout<<"This Program Exiting in "<<sec--<<" seconds...";
Sleep(5000);
}
char cChar;
std::cin.get(cChar);
return 0;
} [/cpp]
I want after 5 seconds program exit.... and didn't write all the word just the time -1 ....
here is my code:::::
[cpp]cout << "PASSWORD: ";
getline (cin,password);
if (password == "my pass")
{
menu();
cout << "Your Choice: ";
cin >> chose;
if (chose == '1')
{
menu2();
}
else
if (chose == '2')
menu3();
}
else
for (i=0; i<=5; i++)
{
cout<<"WRONG PASSWORD!!"<<endl;
cout<<"This Program Exiting in "<<sec--<<" seconds...";
Sleep(5000);
}
char cChar;
std::cin.get(cChar);
return 0;
} [/cpp]
I want after 5 seconds program exit.... and didn't write all the word just the time -1 ....