02-09-2011, 07:31 AM
Hey guys i just tried to code a "very simple login system"
But when i try to compile it says that the last } is a error.
If you don't understand my error then look at this picture:
here is my code:
But when i try to compile it says that the last } is a error.
If you don't understand my error then look at this picture:
Screenshot (Click to View)
Code:
#include <iostream>
#include <windows.h>
#include <winable.h>
using namespace std;
int main(void)
{
string username;
cout << "Enter your username: ";
getline (cin, username);
if(username == "Rand0m")
{
string password;
cout << "Enter your password to access the program: ";
if(password == "iamcool")
{
string answer;
system("CLS");
cout << "Welcome back dude!";
Sleep(2000);
cout << "\nHow have you been?\n";
getline (cin, answer);
if(answer == "bad")
{
cout << "Sorry to hear that.";
}
system("PAUSE>nul");
}