Data Types
One of the problems with C and C++ is that the built-in data types, such
as int and long int, are platform dependent. There is nothing in the standard
to say how many bytes each data type occupies beyond some basic ordering. For
example, long int must use at least as many bytes as int (but it could be the
same). This introduces serious portability problems so ROOT predefines,
for each platform, a set of basic types with guaranteed sizes. For example:-
- Char_t ............. Signed Character 1 byte
- UChar_t ............ Unsigned Character 1 byte
- Short_t ............ Signed Short integer 2 bytes
- UShort_t ........... Unsigned Short integer 2 bytes
- Int_t .............. Signed integer 4 bytes
- UInt_t ............. Unsigned integer 4 bytes
- Long_t ............. Signed long integer 8 bytes
- ULong_t ............ Unsigned long integer 8 bytes
- Float_t ............ Float 4 bytes
- Double_t ........... Float 8 bytes
- Text_t ............. General string
- Bool_t ............. Boolean (0=false, 1=true)
- Byte_t ............. Byte (8 bits)
- Version_t .......... Class version identifier
- Option_t ........... Option string
- Ssiz_t ............. String size
The full set can be found on $ROOTSYS/Rtypes.h
Go Back to the
The ROOT Crib Top Page
If you have any comments about this page please send them to
Nick West