I am making a project in C++ and it gives the following error:
in function 'int main()': Line 35; Col 12; [Error] no match for call to '(std::string {aka std::__cxx11::basic_string}) ()'
This is Line 35:
This is password():
int password() {
string password = "...";
string pass2 = "...";
string val1;
cout << "Would you like to enter Password 1 or 2? ";
cin >> val1;
if (val1 == "1") {
cout << "Enter Password: ";
cin >> val1;
if (val1 == password) {
cout << "Success\n";
} else {
return EXIT_FAILURE;
}
}
}
Can anybody explain and fix this?