This question already has an answer here:
Compare equality of char in C
You should use
strcmp instead of
== because the latter is merely a pointer comparison. Also, '\0' has to be used to end your string. And your current code would actually create an empty string because your string at position
strlen(s) contains '\0'.
Then again, you should not work with char arrays in C++ on your own, rather use
std::string as already pointed out in comments.