Hi ,
A simple stupid question: I am to read the contents of a file that goes this way
RXbytes = 0 b TXbytes = 0 b
RXbytes = 3 Kb TXbytes = 2 Kb
RXbytes = 119 Kb TXbytes = 6 Kb
RXbytes = 189 Kb TXbytes = 5 Kb
RXbytes = 189 Kb TXbytes = 5 Kb
RXbytes = 189 Kb TXbytes = 5 Kb
RXbytes = 189 Kb TXbytes = 5 Kb
and gives this error: & Illegal operator for pointer 2
*** Interpreter error recovered ***
Since = is an operator, is it appropriate to specify it as char? Is it the one that causes trouble in fscanf?
Many thanks
F.
TH1F readThroughput(char *fname, int nread) {
char rec, trans, equal0, equal1;
float rxThoughput, txThroughput;
int i;
char RXunit, TXunit;
TH1F *h = new TH1F("h1","Throughput", nread, 0.5, nread-0.5);
FILE *fp = fopen(fname, "r");
if (fp == NULL) {
printf("Cound not open file %s\n",fname);
return h;
}
for (i=0; i<nread; i++) {
printf("Can you read me?");
fscanf(fp,"%c %c %f %c %c %c %f %c" &rec, &equal0&rxThoughput, &RXunit, &trans, &equal1, &txThroughput, &TXunit);
h->SetBinContent(i+1, rxThoughput);
}
fclose(fp);
h->Sumw2();
return h;
}