writing strings in a tree

Ludger Janauschek (janausch@mppmu.mpg.de)
Wed, 21 Jan 1998 11:08:28 +0100 (CET)


Hello,

when I run the macro

{
gROOT->Reset();

Char_t *string="test string";

TFile f("tree-string.root", "RECREATE");
TTree *t = new TTree("T", "an example");
t->Branch("brString", string, "string/C", 1024);

printf("mark 1\n");
t->Fill();
printf("mark 2\n");

t->Print();
f.Write();
f.Close();
}

root (1.03/09 AIX 4.1) says

mark 1

*** Break *** illegal instruction

What's wrong with the macro and/or how can a branch of a character string
terminated by the 0 character be added to a tree?

Best regards
Ludger Janauschek