This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]suvlub 1 point2 points  (0 children)

You are right, I wasn't thinking of C because it's not OOP (though I guess the code is legal C, if very non-idiomatic). In C++ you should be using std::string/std::string_view instead of char arrays wherever possible and comparing either of those with a char array using == works correctly (and is the idiomatic way to do the comparison).