TH1F *f = new TH1F("a","a",10,0,10) ;
f->SetBinContent(1,5);
f->SetBinContent(2,3);
TH1F *g = new TH1F("b","b",10,0,10) ;
g->SetBinContent(1,1);
f->Draw();
g->Draw();
// you can see that all is right, now
TH1F *h(f); //use copy constructor
h->Draw(); //all ok
(*h) = (*h) - (*g);
h->Draw(); //all ok
g->Draw(); //all ok
f->Draw(); // ???? f is changed! it seems equal to h!
And it should not work, if you programm in C++. Because you are still declaring pointer, but now you are trying to initialize it with non-pointer.
If you want auto variable, use