why the array is static : <p>i have watched tutorial that explain how to return array from function</p>

<p>and this is similar code</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;

int *grn();

int main()
{
    int *a;
    a=grn();
    for(int i = 0;i&lt;10;i++){
        printf("%d\n",a[i]);
    }
    return 0;
}

int *grn(){
    static int arrayy[10];
    srand((unsigned) time(NULL));
    for(int i=0;i&lt;10;i++){
        arrayy[i]=rand();
    }
    return arrayy;
}
</code></pre>

<p>and i have some questions about it..
it is work fine and generate random values inside the array but </p>

<ul>
<li><p>why the function <code>grn</code> is pointer</p></li>
<li><p>and why <code>a variable</code> in the <code>main function</code> is pointer ?</p></li>
<li>why the <code>arrayy array</code> is static?</li>
<li>and why should i make the grn function  pointer?</li>
</ul>

<p>when i try to run this code but the arrayy variable is not static i get <code>segmentation fault</code></p>
