I am really new to c++ just started today. This is my first real program (however useless it is) and i am stuck with one error. I am writing my code on code::blocks using mingGW on windows XP. My error is as following-invalid converion from 'const char*'to 'char'. my code is the following.
#include <iostream>
using namespace std;
int main ()
{
char password;
char PASSCODE="mypasscode";
loop:
cout << "please enter your password:";
cin >> password;
if (PASSCODE==password)
{
int number;
int choice;
cout << "congrats you logged in succesfully";
loop1:
cout << "please enter a number";
cin >> number;
if (number!=1)
{
cout << "you died, too bad";
cout << "press 1 to play again press 2 to close the program:";
cin >> choice;
if (choice=1)
goto loop2;
else
goto loop1;
}
if (number=1)
{
cout << "congrats you won";
goto loop2;
}
}
else
{
cout << "please try again";
goto loop;
}
loop2:
return 0;
}
i looked at the other posts related to this subject but the code was all to complicated for me to understand a scrap of it.