Hi, I am trying to create an array which has size depending on the length of a text file that is read in. My code is as follows:
while(!empFile.eof()){
getline(empFile,line);
// Do not count empty lines or comments
if(line.length() == 0 || line[0] == '#' || line[0] == '/' || line[0] == '$'){continue;}
numberoflines++;
}
int numberofevents=numberoflines/2000;
int arraysize=2*numberofevents;
int scopedata [arraysize][1000];
This returns Error: Non-static-const variable in array dimension ReadFastRoot.C:31:
(cint allows this only in interactive command and special form macro which
is special extension. It is not allowed in source code. Please ignore
subsequent errors.)
How can i get around this?
Thanks