There's a function avg(int, ...) which calculates the average number of input integers,
avg(1,2,3) = 2, avg(2,3,4,5,6) = 4
Now I have an array of integers that need to use avg() to get their average value,
but the array's size is dynamic, maybe read from stdin or from a file.
Code example:
int i, num;
scanf("%d", &num);
int *p = malloc(num * sizeof(int));
for(i = 0; i < num; ++i)
scanf("%d", &p[i]);
// what should I do now?
// avg(p[0], p[1],....)
Note that the avg() function should be called only once.
-- EDITED --
The avg() function is just an example, the real function is more complex than that.