Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help! ( Yes i am noob o.0 )
#2
You are missing 2 or 3 closing brackets.
Here you have the clean code, I think that would do it.

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");
}

Few tips, instead of system("PAUSE"), use cin.get().
And instead of putting if's into if's try using if, else, else if or even switch.

Also, if I may suggest, use Code::Blocks
http://www.codeblocks.org/
Reply


Messages In This Thread
Need help! ( Yes i am noob o.0 ) - by w00pz - 02-09-2011, 07:31 AM
RE: Need help! ( Yes i am noob o.0 ) - by Gaijin - 02-09-2011, 08:29 AM
RE: Need help! ( Yes i am noob o.0 ) - by Untouch - 02-09-2011, 08:40 AM
RE: Need help! ( Yes i am noob o.0 ) - by w00pz - 02-09-2011, 01:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)