Last edited on
What have you declared username as?
char *const username = "jay"; |
Use a string.
std::string username = "jay";
Last edited on
it says no operator "==" matches these operands "std::string"
This is what I have and I am getting no errors.
1 2 3 4 5 6
|
int main(){
string username = "jay";
if (username == "jay") {
cout << "So jay is your name?" << endl;
}
}
| |
Last edited on