define your func as
void get_data(Char_t filename[], Int_t *tlive, Int_t *treal, Int_t *ch_low, Int_t *ch_hi, TH1F *&histo) {…
and it will. See your favorite C++ book on “passing by reference”.
thanks, thanks very much. Without you (and Rene) I will be in trouble. But I don’t understand: if I pass the pointer *histo the function can modify the object histo, or not? why it doesn’t work? You pass a reference to a pointer, but I think it is redundance.
as you said - if you pass the pointer to the histogram, you can modify the histogram in get_data, and allow the calling function to see the modified histogram. But that’s not what you do - you modify the pointer to the histo (before it’s 0, after it’s !=0). So you have to pass the pointer to the histo as reference (or TH1**, but IMHO TH1*& is a lot nicer).