The simplest solution is to use google (First link) here. Also be aware that in C++ we prefer std::string
over const char *
. Do not write your own std::string
, use the built-in one. Your code seems to be more C than C++!
solved Parse string and swap substrings [closed]