Home | News | Documentation | Download

Problem reading file

Hi, I have a problem reading a file that I produce by using Map() on several root files. Everything is piped to a single txt file and the contents of Map() display 5 columns. when trying to read them I only get the first letter or number of the information en each column of each line.

using namespace std;

const char Loadzombie(const char *zombieList);

enum {
  trash   = 0,
  trash2  = 1,
  trash3  = 2,
  here    = 3,
  trash4  = 4,

void check2(){

const char Loadzombie(const char *zombieList){
    FILE *fplist,*fpfile;              //file pointers for filelist and each file therein
    Char_t lline[250];                 //for reading in lines from filelist
    Char_t fline[250];                 //for reading in lines from file
    Char_t filename[250];              //file
    Int_t  fcount=0;                   //counter for no of files read in
    Int_t  chancount=0;                //counter for no of channels read in
    Char_t zombieTable[30];  

    if((fplist=fopen(zombieList,"r"))==NULL){ //open filelist
      cerr << "Error Couldn't open file: " << zombieList << endl;
      return -1;
      cout << zombieList << endl;
      chancount=0;                                             //starting array at 1 for consistency with E_ID
      while((fgets(fline,500,fplist)) != NULL){
	sscanf(fline,"%s"/*""%s %s %s %s %s"*/,
	//cout << zombieTable[trash]<< "  " << zombieTable[here] <<endl;
	cout << zombieTable[0];




I am not sure I get the question. This program does not seem to use ROOT. I suggest to start from one of the many C++ tutorials online in case of issues.