test_tree() { TFile *f = new TFile("testtree.root", "RECREATE"); TTree *t = new TTree("mytree", "mytree"); char str[200]; t->Branch("br", str, "br/C"); strcpy(str, ""); t->Fill(); strcpy(str, ""); t->Fill(); strcpy(str, "aaaa"); t->Fill(); strcpy(str, ""); t->Fill(); strcpy(str, ""); t->Fill(); strcpy(str, "bbbbb"); t->Fill(); strcpy(str, ""); t->Fill(); strcpy(str, ""); t->Fill(); strcpy(str, "ccc"); t->Fill(); f->Write(); f->Close(); }