But I've changed the code to yours, but it gives me the following error:
1. "cin >> password;" - "ERROR: No operator ">>" matches these operands"
2. If (password == "anevilvegetable") - "ERROR: No operator "==" matches these operands"
If you're going to use the string class, as suggested, you'll need to #include <string> .
If you're using character arrays (or C strings), as in your original code, you can compare them using the strcmp_s function. You'll need to #include <cstring> for that function.