{
TCanvas *c1 = new TCanvas(“c1”, “c1”,10,10,600,600);
c1->SetGridx();
c1->SetGridy();
gStyle->SetOptStat(“0000”);
TH2F *h2 = new TH2F(“h2”,"",4,0,2,4,0,2);
h2->Draw();
h2->GetXaxis()->SetNdivisions(4);
//h2->GetXaxis()->SetTitle(“t”);
h2->GetXaxis()->CenterTitle(true);
h2->GetYaxis()->SetNdivisions(4);
h2->GetYaxis()->SetTitle(“j_{s}(#Omega,t)”);
h2->GetYaxis()->CenterTitle(true);
FILE *fp=fopen("/home/Administrator/out/data.prn",“r”);
TFile *f=new TFile(“data.root”,“RECREATE”);
TTree *t=new TTree(“T”,“data from ascii file”);
Float_t x[200][1401];
t.Branch(“x”,x,“x[200][1401]/F”);
Int_t r,c;
for(r=0;r<200;r++)
{
for(c=0;c<1401;c++)
{
fscanf(fp,"%f",&x[r][c]);
//printf("%.3f ",x[r][c]);
}
//printf(“r=%03d c=%04d\n”,r,c);
t->Fill();
}
for(c=1350;c<1401;c++)
{
printf("%d\n",c);
h2->Draw();
t->Draw(Form(“x[][%d][][0]”,c),"",“same”);
}
c1->Modified();
}
i run this programm,but all result is:
Error: Incorrect assignment to c, wrong type ‘int’ t.c:47:
why?
please tell me how to change it
Thanks!