Hello!
I’m trying to read an ascii file and pass the data to two arrays in order to make a plot. But I get this error:
Error: operator>> not defined for basic_istream<char,char_traits
The ascii file is an output file from fortran 77. This file is filled using Format with F specifier.
Anyone knows what can be wrong?
The simple code is here:
{
gROOT->Reset();
#include <Riostream.h>
#include <TGraph.h>
Float_t x[20],y[20],a,b;
ifstream ino;
ino.open(“p.dat”);
TGraph *g;
for(int i=0;i<20;i++){
ino >> b >> a >> endl;
}//for
g = new TGraph(20,x,y);
g->Draw();
ino.close();
}
Thank you very much!!!
Bye!