You shouldn't loop in this manner:
Code:
while(!feof(fp)&&test=getc(fp)!=';')
{
ungetc(test,fp);
fscanf(fp,"%f",&data[i]);
i++;
}
Using feof() in the way isn't guaranteed to produce the desired results. You should check the return code from getc() against EOF to see if you're at the end of a file. To do this, make use the variable you are assigning the return value to is an int.
Code:
int c;
while ((c = getc(fp)) != EOF)
{
/* do stuff */
}
Also, better check the return code from fscanf() to ensure it did actually read a float into the output variable.
The int i needs initialising before you use it too, it's starting value undefined.