How should i return a reference to object without getting a warning for example:
std::string& GetString()
{
std::string str = "Abcdefghijklmnopqrstuvwxyz";
return str;
}
int main()
{
std::string str = GetString();
}
This results a warning on compliation.