#include#include int main() { int value = 42; TString formattedString = TString::Format("The answer is %d", value); std::cout << formattedString.Data() << std::endl; return 0; }
#includeIn both examples, the library used is TString Format, which is part of the ROOT package. ROOT is a large C++ framework for data processing, analysis, and visualization.#include int main() { TString name = "John"; int age = 30; TString formattedString = TString::Format("%s is %d years old", name.Data(), age); std::cout << formattedString.Data() << std::endl; return 0; }