Using my own c++ code.

Daniel Barna (Daniel.Barna@cern.ch)
Tue, 9 Dec 1997 09:22:09 +0100 (MET)


Hi Rooters,
I'm afraid I do some basic error, because the following example is so
trivial, but doesn't work:

TFile file("histo.root")
TH1D *histo = (TH1D *)file.Get("histogram")
int maxbin=histo.GetNbinsX()
for(int i=1;i<=maxbin;i++) {
histo.SetBinContent(i,200);
}

Now, if I draw the histogram, nothing has been changed. But if I modify
the histogram without a for loop:

histo.SetBinContent(3,200)

then I can see the changes when I draw the histogram. Could you help me,
why?
Thanks
Daniel