Array of variable length in TTree

Dear Rooters,

I observed a strange behavior of class TTree and did not find explanation in the manual. Let me show two short simalar examples.

//======== 1.
unsigned char n;
float v[100];
T.Branch(“n”,&n,“n/b”);
T.Branch(“v”,v,“v[n]/F”);

//======== 2.
unsigned short n;
float v[100];
T.Branch(“n”,&n,“n/s”);
T.Branch(“v”,v,“v[n]/F”);

The first example works and the second one does not work.
Why? And is it correctly to use the first variant? In some cases it is very suitable especially when the size of created file is significant.

Thanks in advance,
Andrey

The array count must be an integer variable (Int_t). Depending on the aligment, it is just by chance that it works for shorter types.
Using an Int_t instead of an unsigned char has no impact on the file size. The compression algorithm will take care of eliminating the irrelevant 0s.

Rene