Re: pointers in interactive use

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Jun 03 1998 - 12:48:20 MEST


Hi Damir,

  this:

  TH1F* h3("h3","h3",10,0.,1.)

has never been an allowed extension. This is ok (implicit
declaration of h3 to TH1F*):

h3 = new TH1F("h3","h3",10,0.,1.)

Cheers, Fons.

Damir Buskulic wrote:
> 
> Just a strange behaviour. If you do :
> 
> root [0] TH1F* h3("h3","h3",10,0.,1.)
> root [1] h3
> (class TH1F*)0x300000000000000
> 
> this is not really a good mem location (obviously segfaults if you try
> for example h3->Print() )
> 
> but if you do :
> 
> root [8] TH1F* h4=new TH1F("h4","h4",10,0.,1.)
> root [9] h4
> (class TH1F*)0x14017d3e8
> root [10] h4.Print()
> TH1.Print Name= h4, Total sum= 0
> 
> Everything goes OK. Does that mean that we should, for the time being,
> avoid using the Cint extensions to C++ also in interactive use and not
> only in macros ?
> 
> Cheers
> 
> Damir
> --
> =====================================================================
> | Damir Buskulic                  | Universite de Savoie/LAPP       |
> |                                 | Chemin de Bellevue, B.P. 110    |
> | Tel : +33 (0)450091600          | F-74941 Annecy-le-Vieux Cedex   |
> | e-mail: buskulic@lapp.in2p3.fr  | FRANCE                          |
> =====================================================================
> mailto:buskulic@lapp.in2p3.fr

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910



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