char a string c++ code example Example: char to string c++ std::cout << std::string(1, c) << std::endl;