Hi all,
I would like to get a histogram from a .dat file, but ROOT returns with the following error message (see below with the red colored text):
FILE *fp=fopen("P.dat","r+");
TH1F *hist_1 = new TH1F("histogram","distribution",100,0,1);
hist_1->Sumw2();
hist_1->SetFillColor(48);
Double_t j=0.0;
while((fscanf(fp,"%lf",&j)!=EOF)){printf("the value read is %lf\n",j);hist_1->Fill(j);hist_1->Draw();}
The error:
[color=red]
Error: fscanf param[0]=0 must not be 0 (tmpfile):1:
*** Interpreter error recovered ***
[/color]
Please help me to solve this! What is wrong? Thank you in advance!