Returning a reference to object
<p>How should i return a reference to object without getting a warning for example:</p>

<pre><code>std::string&amp; GetString()
{
    std::string str = "Abcdefghijklmnopqrstuvwxyz";
    return str;
}

int main()
{
    std::string str = GetString();
}
</code></pre>

<p>This results a warning on compliation.</p>
