Accessing char array in TTree

Hello.

I have a program that creates a ROOT file that contains some TTrees. If I want to extract an integer I can use:

int event;
T->SetBranchAddress(“event”,&event);
T->GetEvent(…)

However, whenever I try the following I get “ERROR: String literal syntax error”:

char event[25];
T->SetBranchAddress(“event”,event);

Is there something that I am doing wrong? I know that the tree actually contains the strings I need from viewing the ROOT file with TBrowser.

Thank you for your help.

Corey Fredericks

Hi,

I can not reproduce the problem (Nor do I understand how the message you give can come up with the 2 lines of code you send). Can you be more explicit on the actual issue (ROOT version, OS Version, actuall code that lead to the error, etc…)

Cheers,
Philippe.

Nevermind… I found the error. I made a mistake with a previous declaration. The code that I posted works.

Thank you for your help, though.

Corey