Hello all!
I'm a newbie when it comes to C++ and I need some help checking some syntax.
Code:
srand(time(0));
int cor=rand() % 99999;
string user;
cin >> user;
cin.ignore();
if (user==cor)
{
cout << "Password entered is correct, you may exit the program now.";
exit(1);
}
else
{
cout << "Password is INCORRECT. Application will not terminate.";
}
Any advice I can get would be greatly appreciated! Thanks so much!
I'm a newbie when it comes to C++ and I need some help checking some syntax.
Code:
srand(time(0));
int cor=rand() % 99999;
string user;
cin >> user;
cin.ignore();
if (user==cor)
{
cout << "Password entered is correct, you may exit the program now.";
exit(1);
}
else
{
cout << "Password is INCORRECT. Application will not terminate.";
}
Any advice I can get would be greatly appreciated! Thanks so much!