Afterwards I read from a file the first line, each column corresponds to one variable in the struct (the file has the same order as in the definition of the struct). Then I fill my tree. Everything looks fine so far.
But when I open my tree, only those variables are ok, which are before the char array. The two afterwards are corrupted.
And the funny thing is, using cout before I fill the tree, the output is ok for each variable.
Has anybody an idea, what I should change? Otherwise I can give more information on the program.
The problem is in the leaflist description where the arraytree->Branch("sample", &sample, "a/D:b/D:c/D:name[256]/C:d/D:e/D");
Note that inherently we can not check the validity of the leaf list string. Hence we strongly recommend that instead of using the leaflist, you ought to use the branch creation technique that uses C++ object (i.e. compile the struct and generate a dictionary for it, for example via ACLiC) which will auto-determine the location of the members.