get string char c++ code example
Example 1: c++ get character from string
#include
#include
int main() {
std::string myStr = "test string";
for (int i = 0; i < myStr.length(); ++i) {
std::cout << myStr.at(i) << std::endl;
}
return 0;
}
Example 2: working with char and string c++
String and Char