/// /// \file TestDynamicCast.C /// \brief /// /// <+DETAILED+> /// /// \author Chinmay Borwankar (), /// /// \internal /// Created: 02/20/2020 /// Revision: none /// Compiler: gcc /// Organization: Astrophysical Sciences Division, Bhabha Atomic Research Centre /// Copyright: /// /// This source code is released for free distribution under the terms of the /// GNU General Public License as published by the Free Software Foundation. /// #include "TApplication.h" #include "TROOT.h" #include "TClass.h" //#include "Derived.h" int main(int argc, char* argv[]) { TApplication *theApp = new TApplication("theApp",&argc,argv) ; gROOT -> ProcessLine(".L Derived.C+") ; TClass *cl = TClass::GetClass("Derived") ; TObject *b = (TObject*)cl -> DynamicCast(cl,cl -> New(),kTRUE) ; b -> Warning("Warning","") ; theApp -> Run() ; }