strcmpcompares the actual contents C-string, and when used ==between the two, the C-stringquestion is asked whether these two pointers point charto the same position.
If we have C-string, defined as follows:
char string_a[] = "foo";
char string_b[] = "foo";
char * string_c = string_a;
strcmp(string_a, string_b) == 0 true, string_a == string_b false. "" string_a string_c == true.
C-string, , strcmp.
: C++ C, , std::string. ,
std::string string_d = "bar";
std::string string_e = "bar";
string_d == string_e true. string_d.compare(string_e) 0, C++ strcmp.