Pointer returns and scope
<p>Is returning a pointer declared inside the function considered bad practice?  Example:</p>

<pre><code>int* foo(void)
{
    int * ret_val = 1234;

    return ret_val;
}
</code></pre>

<p>I believe you're suppose to use: </p>

<pre><code>static int * ret_val = 1234;
</code></pre>

<p>But then again, wouldn't it still be considered bad practice to return memory outside of your scope? </p>