Illegal operator for real number

I’m trying to grab two input files and assign their values to some arrays. I don’t understand the error I’m getting:

root [0] #include <fstream>; root [1] ifstream energy[100000], probfile[100000]; root [2] energy.open("~/Desktop/energyhist.dat"); root [3] probfile.open("~/Desktop/probfile.dat"); root [4] Double_t e1[100000], p[100000]; root [5] for( Int_t i=0; i<100000; i++) { end with '}', '@':abort > energy >> e1[i]; end with '}', '@':abort > probfile >> p[i]; end with '}', '@':abort > } Error: >> Illegal operator for real number (tmpfile):1: (class basic_ifstream<char,char_traits<char> >*)0x2c05008 *** Interpreter error recovered ***

Any idea?

[quote=“ultimateguy”]I’m trying to grab two input files and assign their values to some arrays. I don’t understand the error I’m getting:

root [0] #include <fstream>; root [1] ifstream energy[100000], probfile[100000]; root [2] energy.open("~/Desktop/energyhist.dat"); root [3] probfile.open("~/Desktop/probfile.dat"); root [4] Double_t e1[100000], p[100000]; root [5] for( Int_t i=0; i<100000; i++) { end with '}', '@':abort > energy >> e1[i]; end with '}', '@':abort > probfile >> p[i]; end with '}', '@':abort > } Error: >> Illegal operator for real number (tmpfile):1: (class basic_ifstream<char,char_traits<char> >*)0x2c05008 *** Interpreter error recovered ***

Any idea?[/quote]

Why do you need static arrays of input streams? :smiley: :wink:

BTW, just a recommendation, local stack usually has a limit :wink: You therefore may think of avoiding to use such a big static array as your data container, otherwise … :blush: