adrianmak
asked on
run time error
I have the following program code that read a text file and store it into a array of structure declare as below
compliation is success but when runnung the program a error 'scanf : floating point formats not linked'
#include <stdio.h>
#include <string.h>
void main()
{
struct score
{
float money;
char name[4];
};
struct score ming[11];
int count, index;
int exchange_count, pass, check;
int start, middle, end, found, value;
char temp[4], input_data[4];
FILE *fp;
fp = fopen("datafile.txt","r");
for ( count = 1; count <= 10; count++ )
fscanf(fp,"%s %f",&ming[count].name,&min g[count].m oney);
fclose(fp);
}
compliation is success but when runnung the program a error 'scanf : floating point formats not linked'
#include <stdio.h>
#include <string.h>
void main()
{
struct score
{
float money;
char name[4];
};
struct score ming[11];
int count, index;
int exchange_count, pass, check;
int start, middle, end, found, value;
char temp[4], input_data[4];
FILE *fp;
fp = fopen("datafile.txt","r");
for ( count = 1; count <= 10; count++ )
fscanf(fp,"%s %f",&ming[count].name,&min
fclose(fp);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.