TList question

From: Florian Schopper (fls@ipp-garching.mpg.de)
Date: Mon Oct 05 1998 - 15:41:07 MEST


Dear Rooters,

What is the proper way of calling a member function of an 
Object which is stored in a TList?
When I call it in the following way, I get an error for all members 
except the last in list.

.L Det.so
TList l;

l.Add(  new MChip() );
l.Add(  new MChip() );
l.Add(  new MChip() );

( (MChip *) l.At(2) )->NHitHist.Draw(); // The last in list works
( (MChip *) l.At(1) )->NHitHist.Draw(); //  gives segmentation violation

MChip is my own class which includes a Histogram called NHitHist.
Calling NHitHist.Draw works for all MChip Objects when I don't add them 
to the list.

----------------------------------------------------------------------
Florian Schopper                     office: Max-Plank-Institut fuer
                                             extraterrestrische physik
Ludwig-Merk str. 3                           Postfach 1603
80805 Muenchen                               Giessenbachstr.
phone: 49/89/3226157                         Garching bei Muenchen

                                             phone: 49/89/3299 3625
                                               fax: 49/89/3299 3569
                                            e-mail: fls@mpe-garching.mpg.de
                                              http://wwwcn1.cern.ch/~fschoppe
----------------------------------------------------------------------
-----------------------------------------------------------------------
                                   
          



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:38 MET