c++ – How to compare two strings of type std :: string

Question:

There are two variables of type string . Tell me the methods of their comparison.

Answer:

Hmm … Just take and compare:

std::string a = "Hello", b = "World";
...
a < b;
a > b;
a == b;
a != b;
Scroll to Top