[ROOT] ROOT knows the existence of undefined object

From: Alexander Dietz (Alexander.Dietz@mpi-hd.mpg.de)
Date: Thu Jun 27 2002 - 15:53:25 MEST


Hello,

in the attachement there is a small program with a function 'getH' that
should return a histogram (as a real histogram, not as a pointer).
When starting the program (using ROOT Version 3.02/07 on g++-Linux) with
'prog()' two histograms 'h2' and 'h3' are created with the function
'getH'.
When trying to create 'h3' the value of 'counter' is 1, so that the adress
of 'h1' in 'getH' is printed out. Ths works but 'h1' is not defined yet!!
'h1' will be defined some lines later ('TH1F h1=...').
But why do ROOT know the existence of 'h1' before its creation?
Does ROOT not delete 'h1' at the end of 'getH' (as it is the standard
procedure for any C++ program)?
Is this a bug? Or is this extra property of ROOT?

Cheers

	A. Dietz






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