<p>I have a function that takes a struct, and I'm trying to store its variables in array:</p>

<pre><code>int detect_prm(Param prm) {
  int prm_arr[] = {prm.field1, prm.field2, prm.field3};

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

<p>But with <code>gcc -Wall -ansi -pedantic-errors -Werror</code> I get the following error:</p>

<blockquote>
  <p>initializer element is not computable at load time</p>
</blockquote>

<p>It looks fine to me, what's wrong?</p>

This is illegal in C. Initializer lists must be constant compile time expressions. Do the following instead:
```
```
int prm_arr[3];

prm_arr[0] = prm.field1;
prm_arr[1] = prm.field2;
prm_arr[2] = prm.field3;
```
```