Dec 7, 2016 at 9:54am
Last edited on Dec 7, 2016 at 9:55am
Dec 7, 2016 at 10:08am
What have you declared username as?
Dec 7, 2016 at 10:22am
char *const username = "jay"; |
Use a string.
std::string username = "jay";
Last edited on Dec 7, 2016 at 10:22am
Dec 7, 2016 at 10:30am
it says no operator "==" matches these operands "std::string"
Dec 7, 2016 at 10:49am
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 Dec 7, 2016 at 10:50am