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
----------------------------------------------------------------------
-----------------------------------------------------------------------