Function call in C with array
<p>I have a function that takes array 1 and copies/manipulates it to array 2. Basically what it does is take the user input in array one, lets say (2, 3, 3) and array 2 is stored as (2, 0, 3, 0, 3). I know this works because it worked without implementing a function but sadly I have to have one. I cannot for the life of me figure out how to call the function, I believe I don't need a return since its a void and not returning a value. Below is my code any help would be appreciated.</p>

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

void insert0(int n, int a1[], int a2[]);

int main() {

int i = 0;
int n = 0;
int a1[n];
int a2[2*n];

printf("Enter the length of the array: ");
scanf("%d",&amp;n);

printf("Enter the elements of the array: ");

for(i = 0; i &lt; n; i++){ //adds values to first array
        scanf("%d",&amp;a1[i]);
}

insert0(); //call function which is wrong and I cannot get anything to work

for( i = 0; i &lt; n*2; i++){ //prints array 2
        printf("%d", a2[i]);
        }

void insert0 (int n, int a1[], int a2[]){ //inserts 0's between each number

for(i = 0; i &lt; n; i++){
        a2[i+i] = a1[i];
        a2[i+i+1] = 0;
        }
}
}
</code></pre>