There are some possibilities:
Pointer to an array:Code
float *text;
text = (float*)malloc(2*sizeof(float));
fscanf(fp, "%f", &text[0]);
printf("Number: %.2f\n", text[0]);
Array of pointers:Code
float *text[2];
text[0] = (float*)malloc(sizeof(float));
text[1] = (float*)malloc(sizeof(float));
fscanf(fp, "%f", text[0]);
printf("Number: %.2f\n", *text[0]);
Normal array:Code
float text[2];
fscanf(fp, "%f", &text[0]);
printf("Number: %.2f\n", text[0]);
This post was edited by dipdipdip on Dec 13 2012 10:56am