Possible Duplicate:
C dynamically growing array
I have a program and I need to read floats from a file. Each line is one float number. The problem is that this file may be very large
float tab[1000];
f = fopen ("data.txt", "r");
i=0;
while (feof(f) == 0) {
fscanf (f, "%f\n", &tab[i]);
i++;
}
How may I change size of array dynamicaly if it's too small?