(no subject)

Rene Brun (Rene.Brun@cern.ch)
Tue, 09 Dec 1997 09:40:41 +0100


Daniel Barna wrote:

> 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

You must have semicoluns ";" at the end of your C++ statements

Rene Brun