[ROOT] graph array problem

From: Avdhesh Chandra (avdhesh@tifr.res.in)
Date: Thu Oct 10 2002 - 16:43:27 MEST


Hi,
    I am trying to make graph array, so i can use it.

 programe looks like(where i am defining graph array)

 for(int i = 0 ; i < nent ; i++)
   {
     cout << "  Col[i]  " << Col[i] << endl;
     gr[i] = new TGraphErrors(n,Z,Ent[i],Ez,Eent[i]);
     gr[i]->SetMarkerColor(Col[i]);
     gr[i]->SetMarkerStyle(Sty[i]);
   }

when i am running my code  i am getting following message

---------------------------------------------------
  Col[i]  7
  Col[i]  6
Error: Array index out of range gr -> [1]  valid upto gr FILE:test.C
LINE:156

 *** Break *** segmentation violation
---------------------------------------------------


Which shows that when it goes secound time in the loop it having problem.
Please let me know what i am doing worng.

Thanks for any help
Avdhesh



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:13 MET