#include #include #include #include #include #include #define NOFCHANNELS 5 using namespace std; int crash() { ifstream ifs("trial_3.txt"); // construct the interface to the file string line; ifstream ifs("trial_3.txt"); while(!ifs.eof()) { int bin = 1; float entries[NOFCHANNELS]=0; line.clear(); getline(ifs, line); //get and store the entire line of the file const char* cline = line.c_str(); // convert string to char sscanf(cline, "%f %f %f %f %f", &entries[0], &entries[1] ,&entries[2],&entries[3],&entries[4]); //read and store data from string /*for(int i=0;iSetBinContent(bin,entries[i]); }*/ bin++; } }