LJ Archive

Listing 3. C++ Macro for Storing Database Information

//----------- begin fill.C
{
 gSystem->Load("Person.so");
 TFile *f = new TFile("test.root","recreate");
 Person *t;
 for (int i = 0; i < 1000; i++) {
 char s[10];
 t = new Person(i, i+10000);
 sprintf(s, "t%d", i);
 t->Write(s);
 delete t;
 }
 f->Close();
}
//----------- end fill.C
LJ Archive