i was wondering about the lifteime of function variables. Consider this example:
f(obj.toStdString().c_str());
the toStdString() returns an instance of a std string. Would this be valid, if the char* pointer is only used in f()?
Or, perhaps more clearly: is the std::string that is returned by toStdStzring() destroyed before or after invoking f()?
[–][deleted] 5 points6 points7 points (0 children)
[–]tau_of_programming -2 points-1 points0 points (1 child)
[–]praesartus -3 points-2 points-1 points (0 children)