line 8: don't you see something a little strange about that line? hint: () and ;
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>>int main ();
Of course not -- get rid of the semicolon!
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
You need to add { and } when there are more than 1 lines within while statements
while( <condition> )
{
// some lines here
}
else
{
// more lines here
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
braces are still wrong -- they are backwards and the closing } is on the wrong place. Re-read my previous post again. You need to count the number of opening and closing braces and make sure there is a } for every { (and vice versa)
line 11: delete the semicolon at the end of that while statement
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
This is how to format the code. I also change a couple of other errors -- you had << and >> reversed. cout uses << and cin uses >>, you have them backwards.
>>if(password == Enter Password)
That is also wrong but I don't know how you need to correct it.
Help with Code Tags (Toggle Plain Text)
int main()
{
int secondnumber;
while(true)
{
cout << "Enter Password";
cin >> secondnumber;
if(password == Enter Password)
{
cout<<"Welcome Lukus";
}
else
{
cout<<"Password Rejected";
}
}
system ("PAUSE")
return 0;
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>>if(password == Enter Password)
Should be testing for secondnumber
if(password == secondnumber)
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343