i dont know but this not working for me im getting garbege value when i try to set char * value from function that returns std string :
string foo() { st
The code-snippet invokes undefined behavior, because the temporary std::string created from the call is destroyed at the end of the expression but cc which is pointing to the destroyed object, is still used even after that.
std::string
cc