Error: fscanf

Hi,

I would like to plot some histogram from a given data, but I get the following error messages and I do not know what is wrong:

root [0] FILE *fp=fopen("data.dat","r+");  
root [1] TH1F *hist_1 = new TH1F("histogram","some distribution",100,0,1);
root [2] hist_1->Sumw2();
root [3] Double_t j=0.0; 
root [4] while((fscanf(fp,"%lf",&j)!=EOF)){printf("the value read is %lf\n",j);hist_1->Fill(j);hist_1->Draw();}
Error: fscanf param[0]=0 must not be 0 (tmpfile):1:
*** Interpreter error recovered ***

Any ideas?

Error: fscanf param[0]=0 must not be 0 (tmpfile):1: CINT thinks fp is 0. Maybe the file data.dat does not exist or is not readable?
Cheers,
Philippe.