Listing 1:Hello World in ROOT

$ root -l

root [0] std::cout << "Hello World" << std::endl;
Hello World
root [1] class mytest {
root (cont'ed, cancel with .@) [2] public:
root (cont'ed, cancel with .@) [3] mytest() {print();}
root (cont'ed, cancel with .@) [4] void print() {std::cout << "Hello again!" << std::endl;}
root (cont'ed, cancel with .@) [5] void print(int i) {std::cout << "Hello " << i << std::endl;}
root (cont'ed, cancel with .@) [6] };
root [7] mytest MyTest;
Hello again!
root [8] std::shared_ptr<mytest> MyTest_ptr(new mytest);
Hello again!
root [9] MyTest_ptr->print(2);
Hello 2
root [10] MyTest.print()
Hello again!
root [11] MyTest.print(
root (cont'ed, cancel with .@) [12])
Hello again!
root [13] MyTest.print(MyTest_ptr)
ROOT_prompt_13:1:8: error: no matching member function for call to 'print'
MyTest.print(MyTest_ptr)
~~~~~~~^~~~~
ROOT_prompt_5:1:6: note: candidate function not viable: no known conversion from 'std::shared_ptr<mytest>'
      to 'int' for 1st argument
void print(int i) {std::cout << "Hello " << i << std::endl;}
     ^
ROOT_prompt_4:1:6: note: candidate function not viable: requires 0 arguments, but 1 was provided
void print() {std::cout << "Hello again!" << std::endl;}
     ^
root [14]
