For general string comparisons, strcmp
is the appropriate function. You should use strncmp
to only compare some number of characters from a string (for example, a prefix), and memcmp
to compare blocks of memory.
That said, since you’re using C++, you should avoid this altogether and use the std::string
class, which is much easier to use and generally safer than C-style strings. You can compare two std::string
s for equality easily by just using the ==
operator.
Hope this helps!