c++ convert char * to string code example Example: char * to string c++ const char *s = "Hello, World!"; std::string str(s);