-
auto s = "abcd"creatsconst char *not string, so useautowith caution. -
Since a string in C++ is an array of chars, you can operate it like an array. For example, you can use range-based for loop and so on.
-
It is recommended that you use
std::stringin …