Dear rooters i am using root version : 3.10/02 : system : suse 9.1 professional , gcc -> 3.3.1 (SuSE Linux) I am getting the following errors Error: non class,struct,union object $i used with . or ->Error: Symbol i is not defined in current scope FILE:bstring.h LINE:2523 Error: Failed to evaluate i.operatorvoidError: Binary operator oprand missing FILE:bstring.h LINE:2523 *** Interpreter error recovered *** and here is my macro. { It is working well as a c++ program. } #include <string> #include <iostream> #include <sstream> #include <fstream> rootsala() { string s1; fstream f("/data1/mrk1.txt",ios::in); if (f.is_open()) cout <<"The file has been opened properly \n"; else { cout <<"The file has not been opened properly \n"; exit(0); } int prun=0,pcount=0; int crun=0,ccount=0; int drun=0,dcount=0; while (!f.eof()) { f>>s1; string s2(s1,9,6);// (mother string,index of first char, no.of chars to be copied //cout <<"s1 = "<<s1<<endl; stringstream ss (stringstream::in | stringstream::out); ss.str(s2); if(s1.find("P") != string::npos) { ss>>prun; pcount++; cout <<"prun "<<pcount<<" = "<<prun<<endl; } if (s1.find("D") != string::npos) { ss>>drun; dcount++; cout <<"drun "<<dcount<<" = "<<drun<<endl; } if (s1.find("C") != string::npos) { ss>>crun; ccount++; cout <<"crun "<<ccount<<" = "<<crun<<endl; } } cout <<"No.of Pedestal Files = "<<pcount<<endl; cout <<"No.of Calibration Files = "<<ccount<<endl; cout <<"No.of Data Files = "<<dcount<<endl; } waiting for reply Praveen boinee Dep. Physics Udine University Udine Italy
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET