AnsweredAssumed Answered

Reading txt file on k60 MQX

Question asked by corrado carini on Nov 17, 2011
Latest reply on Nov 23, 2011 by Michele Marchetti

I'm trying to run a code on k60 with MQX 3.6.2.

The code is tested on PC and everything is ok.

 

typedef struct
{
char dbver[20];
char marca[20];
char modello[20];
char dettaglio[20];
uint_32 gas;
char olio[10];
} DB_DATA;

.

.

.

FILE *fp;

DB_DATA prec,;

.

fp=fopen("a:/file.txt","r");

.

fscanf(fp,"%s%s%s%i%s",prec.marca,prec.modello,prec.dettaglio,&prec.gas,prec.olio);

 

Txt file is composed by rows so made:

name1 name2 name3 500 name4

with spaces (I tried even with tabs) between names/number.

In prec.marca I find all the line and program (of course...) goes in error.

 

Someone can help me? 

Thanks and regards

Outcomes