There is apparently a problem with typedef in CINT.
I am using version 3.03/09 and type the following lines at the root prompt:

typedef Float_t Array[2];
.typedef Array
Array a;
Float_t b[2];
a[0] = 1.0;
b[0] = 1.0;
cout << a[0] << " " << b[0] << endl;

root tells me:
root [0] typedef Float_t Array[2];
root [1] .typedef Array
List of typedefs
1 typedef float Array[2]
root [2] Array a;
root [3] Float_t b[2];
root [4] a[0] = 1.0;
root [5] b[0] = 1.0;
root [6] cout << a[0] << " " << b[0] << endl;
0x3f800000 1

So Array is known to be a float[2] type, but when I use it, it gives
the wrong answer ?!

Markus Cristinziani

It seems that CINT is somehow storing pointers to the variables. In
your example, *a and *(a+1) work as expected, at least with CVS
ROOT 4.00/01. Also, note that making typedefs of arrays serves
very little purpose in C/C++.


This problem is a side effect from recent change. It should be fixed in the latest version 5.15.123.

Thank you
Masa Goto