Re: TString question *** SOLVED ***

Nick van Eijndhoven (Nick@fys.ruu.nl)
Sun, 15 Mar 1998 20:42:50 +0100 (MET)


*** Radovan Chytracek wrote :
>
> On Sun, 15 Mar 1998, Nick van Eijndhoven wrote:
>
> > TString* s; // In the private area of Myclass
> >
> > // Next 2 lines are in the member function void Myclass::doit1()
> > s = new TString("test");
> > cout << " First test output " << s->Data() << endl;
> This is OK, private member `s' is initialized already.
>
> > // Next 2 lines are in the member function void Myclass::doit2()
> > cout << " Here comes the second." << endl;
> > cout << " Second test output " << s->Data() << endl;
> In this case there is no guarantee that `s' is already initialized to
> point to some memory area containg its data.
>
> The method Myclass::doit2() can be used in the case when MyClass
> constructor does the `s' initialization before the Myclass::doit2()
> is called.
>
> Happy ROOTing
>
> Radovan
>
>
>
Dear ROOTers,
The problem mentioned above has been solved (MEA CULPA).
Radovan was pointing in the right direction, however it was not a wrong
order of initialisation, but a typing error of me.
Sorry to have bothered you several times about this.

*** Thanks again Radovan for all your help !!! ***

Cheers,

_/_/ _/ _/ _/_/_/_/ _/ _/
_/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/_/
_/ _/_/ _/ _/ _/ _/
_/ _/ _/ _/_/_/_/ _/ _/

*----------------------------------------------------------------------*
Dr. Nick van Eijndhoven Department of Subatomic Physics
email : nick@fys.ruu.nl Utrecht University / NIKHEF
tel. +31-30-2532331 (direct) P.O. Box 80.000
tel. +31-30-2531492 (secr.) NL-3508 TA Utrecht
fax. +31-30-2518689 The Netherlands
WWW : http://www.fys.ruu.nl/~nick Office : Ornstein lab. 172
----------------------------------------------------------------------
tel. +41-22-7679751 (direct) CERN PPE Division / ALICE exp.
tel. +41-22-7675857 (secr.) CH-1211 Geneva 23
fax. +41-22-7679480 Switzerland
CERN beep : 13+7294 Office : B 160 1-012
*----------------------------------------------------------------------*