Operator>> not defined for basic_istream

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!

ino >> b >> a >> endl; is incorrect C++ (You are attempting to modify the value of ‘endl’). If you use: ino >> b >> a;it works correctly both with the compiler and CINT.

Cheers,
Philippe

This is for all the versions of root?

I think that I’ve done that with endl in the past.

Anyway, thank you very much!!!

[quote]This is for all the versions of root? [/quote]Yes it should. You must have done this for the output.

Cheers,
Philippe