So like I said I made a function to check the password and for some reason it won't work when I put in the string for x nothing happens the program just ends
#include <iostream>
#include <string>
usingnamespace std;
int password_check(string x)
{
x = "blah";
while (x != "blah") {
cout << "Please enter the correct password\n";
cin >> x;
if (x == "blah") {
cout << "Congrats you can go in";
}
}
}
int main()
{
string x;
cout << "Please enter your password: ";
cin >> x;
password_check(x);
}