[ROOT]std::ifstream error

From: Exaos Lee (schlie@iris.ciae.ac.cn)
Date: Fri May 30 2003 - 02:29:09 MEST


Dear rooter,
I want to read data from a binary data file and an ascii file. My codes 
are below:
-------
...
// Index file: ASCII format, each line containing one event filename
// for processing.
std::ifstream idx_in("event_index.txt",ios::in);
std::ifstream evnt_in;  // Kmax .evnt file stream
std::string   evnt_fn;  // .evnt filename
...
do {
	idx_in >> evnt_fn; // read a filename
	if(evnt_fn.isempty() && idx_in.eof()) break;
	evnt_in.open(evnt_fn,ios::in | ios::binary) ;
	...
} while(!idx_in.eof());
-------
When root reach this line: "idx_in >> evnt_fn;", it warns me:
=======
Error: operator>> not defined for basic_ifstream<char,char_traits<char> 
 > FILE:evnt2root.C LINE:67
*** Interpreter error recovered ***
=======
What's wrong with my codes?

Regards

Exaos



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET