Can't trouble shoot this!

closed account (38qG1hU5)
#include <iostream>
#include <string>

using namespace std;
string password = "yes"; //what is going to be overridden.
string input;



void start(){


cout<<"Please input your password: ";
cin>> input;

if (input == password)
{
cout<< "Correct";
}//correct

if (input == "dsx413"){
password == "password"; //what is overriding it. but for some reason is overriding
start(); //restarts from the top but doesn't reset password.
input;
}//changer

else {

cout<<"Password Incorrect";
}//else
}//start





int main(){
start(); //initializes the void.
}
Last edited on
1
2
password == "password"; // equality comparison (this is what you did)
password = "password"; // assignment (this is what you intended to do) 
Topic archived. No new replies allowed.