The exercise says \"Make a function with parameters two int arrays and k which is their size. The function should return another array (size k) where every element of it is the
Its impossible to first do a[g] when dynamically getting g.
a[g]
g
Your first lines in main should be:
int i,g; int *a,*b; printf("Give size of both arrays: "); scanf("%d",&g); a = (int *)malloc(g*sizeof(int)); b = (int *)malloc(g*sizeof(int));