Hello, I have a question to ask whoever can help me.
I've have dev - c++. see I've been using C++ for a while now but i'm still sorta a newbie...
i havn't had this problem before but i've been trying to do a password program just to play around with it
and any way whenever i type in the command 'else'
i try to comple it bu it says this:
error: expected primary-expression before "else"
error: expected `;' before "else"
and theres not a thing wrong with my file... is there?
heres my program:
#include <iostream>
#include <windows.h>
using namespace std;
int main ()
{
string password;
cout <<"Please input a password to enter successfully:" <<endl;
getline (cin, password);
if (password == "pen15");
{
cout <<"Welcome";
}
else
{
cout <<"invalid"<<endl;
system ("pause");
return 0;
}
system ("pause");
return 0;
}
like.. where the hell am i supposed to add that other semi colon?
i try puting the semi colon right in front of else - dosn't work
i put it affter the } before the else - dosn't work...
plz help me...