Hi,
I am running ver3.05/07.
I need to skip a few lines of text in a text file so i can begin reading the data:
Acoustic data file.
[nxBins][nyBins][nzBins] = [60][60][1000].
Incident Particle = 1.00000e+00TeV pi+
0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00...
I try and use the getline() function to read in the first three lines and thus leave me ready to read in the data:
...
// Read from .dat file.
ifstream datFile;
datFile.open("Acoustic.dat");
// need buffers to read first few lines into.
TString nameOfFile;
datFile.getline(nameOfFile,128);
TString binInfo;
datFile.getline(binInfo,128);
TString particleInfo;
datFile.getline(particleInfo,128);
...
datFile.close();
...
However this causes a segmentation fault Please help me!
Thanx in advance
Jon