#include#include using namespace std; int main() { TObject* obj = new TObject(); cout << "Object Name: " << obj->GetName() << endl; return 0; }
Object Name: TObject
#include#include using namespace std; int main() { TH1F* hist = new TH1F("hist", "Histogram Example", 100, 0, 100); cout << "Histogram Name: " << hist->GetName() << endl; delete hist; return 0; }
Histogram Name: histIn conclusion, the TObject GetName function is a useful tool for retrieving the name of an instance of a class in C++. Based on the examples given, it is most likely that this function is part of the ROOT package library.