void a(){
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][1201];
t.Branch(“x”,x,“x[200][1201]/F”);
Int_t r,c;
for(r=0;r<200;r++)
{
for(c=0;c<1201;c++)
{
fscanf(fp,"%f",&x[r][c]);
//printf("%.3f ",x[r][c]);
}
printf(“r=%d\n”,r);
t->Fill();
}
for(c=1;c<1201;c++)
{
h2->Draw();
t->SetMarkerColor(4);
t->SetMarkerStyle(20);
t->SetMarkerSize(0.3);
t->Draw(Form("x[][%d]:x[][0]",c),"","same");
h2->SetTitle(Form("#Omega=%.3f",c*0.01));
h2->GetXaxis()->SetTitle(Form("#Omega=%.3f",c*0.01));
c1->Print(Form("/home/Administrator/pic/%d.gif",c));
}
// t->Draw(“x[][125]:x[][0]”,"",“same”);
//t->Draw(“x[][1]:x[][0]”,“x[][0]>0.5”,“same”);
//c1->Print(“3d.gif”);
c1->Modified();
}
i run this programm,but all result is:
[size=150][color=blue]Error: Incorrect assignment to c, wrong type ‘int’ t.c:47:[/color][/size]
why?
please tell me how to change it
Thanks!
a.c (1.45 KB)
data.rar (241 KB)