Can I define a function which returns a reference to an array with a fixed size?
<p>This function accepts an int, and fill an array of 10 ints with that value, and returns a pointer to that array. How can I do the same thing but return an reference to an array?</p>

<pre><code>int (*g(int n))[10]
{
    int (*ptr)[10] = (int (*)[10])malloc(sizeof(int) * 10);
    for (int i = 0; i &lt; 10; i++) {
        (*ptr)[i] = n;
    }
    return ptr;
}
</code></pre>

<p>Something like</p>

<pre><code>int (&amp;h(int n))[10]
{
    // How to do this
    int (&amp;ref)[10] = ???;
    for (int i = 0; i &lt; 10; i++) {
        ref[i] = n;
    }
    return ref;
}
</code></pre>