How to store values inside an empty array and get the average integer? [UPDATED QUESTION]
The error message is correct. You did not define the size of the array.
You have 3 choices:


Declare it with a constant length

int foo[10];
Declare it and initalize it

int foo[] = {0,1,2,3,4,5,6,7,8,9};
Declare it dynamic as pointer and alloc or realloc the mem by yourself (this is not recommended (realloc) because of possible heap memory fragmentation)

int foo;
int size = 10;
foo = (int)malloc(size * sizeof(int));
free(foo);


As reference:
http://www.arduino.cc/en/pmwiki.php?n=Reference/Array