TTree::ReadFile & strings

Hi there,

I have a 2 column ascii file : the 1st is filled with doubles, the 2nd with strings.
I can get back the value of each doubles but don’t manage to get that of strings: TTree *tree = new TTree () ; tree->ReadFile("myfile.dat","mydouble/D:mystring/C") ; tree->GetEntry(0) ; printf ("\n%e\n",tree->GetLeaf("mydouble")->GetValue(0)) ; /// ...I’ve tried to use TLeafC which has a GetValueString() method, in vain.
Another solution seems to be using TLeaf::ReadValue(ifstream&) as one may suppose from reading the following post
I cannot figure out how to proceed though. Could you please help me?


Ooooops… :blush:
Could you, Mr Moderator, please move this post to the “ROOT Support” forum (or remove it completly, I’ll post it again properly)?
Sorry :unamused:


The easiest is to do:char *str = (char*)tree->GetLeaf("mystring")->GetValuePointer(); orchar *str = new char[256]; tree->SetBranchAddress("mystring",str);


Cheers Philippe