#include "TCanvas.h" #include "TTree.h" #include "TString.h" #include void tmp() { TTree* tree1 = new TTree("tree1", "tree1"); std::string* str1 = new std::string; tree1->Branch("str", "std::string", &str1); TTree* tree2 = new TTree("tree2", "tree2"); char str2[10]; tree2->Branch("str", &str2, "str[10]/C"); const Int_t kN = 10; for(Int_t i = 0; i < kN; i++){ str1->assign(Form("%02d", i)); sprintf(str2, Form("%02d", i)); for(Int_t j = 0; j < i + 1; j++){ tree1->Fill(); tree2->Fill(); } // j } // i TCanvas* can = new TCanvas; can->Divide(2, 1); can->cd(1); // tree1->Draw("str>>htemp1(10)"); <= this works, but ugly tree1->Draw("str"); can->cd(2); tree2->Draw("str"); }