C++ Syntax: (class)


This is used to covert a value from one type to another. Its called type casting. By far the most common form to be found the MINFast macros is the conversion of a TObject pointer to a class that inherits from it. For example:- (REROOT_GAFKey *) gafkeys->At(0) Here gafkeys is a pointer to TClonesArray whose At member function returns a pointer to TObject which is then converted to a REROOT_GAFKey pointer by the cast expresssion. See operator precedence

Other Uses for type_cast


Usage Notes

Go Back to the The C++ Crib Top Page

If you have any comments about this page please send them to Nick West