[ROOT] Problems with loops and conditional statements

From: Chris Milne (phycm@phy.hw.ac.uk)
Date: Wed Sep 05 2001 - 14:44:29 MEST


Hi there,

In amongst my code I have the following loop:

for(j=0;j<q;j++)
{    
  if((!data4.fail())&&(time_olp==time_scp[j]))
  {
    for(i=0;i<p;i++)
    {
      data4 >> temp>>OD_olp[i][j];
    }
  }
}
   
Now for some reason when data4.fail() I get a segmentation error, commenting out this section rectifies the problem, thus for some reason 
even though the if statement is not met, and the subsequent instructions are not executed, it gives a fault.

I'm still using root 2.25 (root 3.02 doesn't like my code!)

Any ideas?

Cheers
Chris Milne



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET