Q
qazmlp
Is this code reliable? Basically, I want to know whether returning
copy of the temporary string object is valid or not.
#include <iostream>
std::string returnString()
{
return std::string( "TempString" ) ;
}
int main()
{
std::cout<< returnString() << std::endl;
}
copy of the temporary string object is valid or not.
#include <iostream>
std::string returnString()
{
return std::string( "TempString" ) ;
}
int main()
{
std::cout<< returnString() << std::endl;
}