Hello,
I have a problem with reading a textfile. My actual code:
Code:
int main(int argc, char *argv[])
{
char *pstr[30];
float *pflo[20];
FILE *datin;
int i,j,readint;
datin=fopen("data.dat","r");
/* Data file holds always exactly 9 values */
for (j=0; j<=8; j++)
{
readint = fscanf(datin, "%s%f", pstr[i], &pflo[i]);
/* Output */
printf("%s\t%f\n", pstr[i], &pflo[i]);
}
/* Close*/
fclose(datin);
return 0;
}
the textfile looks like
Machine1 2.00012
Machine2 2.04523
...
...
and so on until Machine9
I get always an memory access error and don't know why.