This looks suspect:
You get a pointer from a temporary string object. This pointer is then invalidated once this temporary string object is destroyed. Is there any reason why you cannot write instead:Code:const char* array = stream.str().c_str();
?Code:std::string array(stream.str())





Reply With Quote