//------------------------------------------------------- // simple struct with data members of different types. //------------------------------------------------------- struct X{ int x1, x2; }; int g_times_ten(int x ) { return 10*x; } namespace no_place_like_a_namespace { int times_ten(int x ) { return 10*x; } } TH1D* get_th1d_ptr() { static TH1D h ("h","h",10,0,10); if ( h.GetEntries() == 0 ) { for (int i=0 ; i< 1000; i++) h.Fill(i%10); } return &h; } TH1D& get_th1d_ref() { static TH1D h ("h","h",10,0,10); return h; } TH1D get_th1d() { static TH1D h ("h","h",10,0,10); for (int i=0 ; i< 1000; i++) h.Fill(3); return h; } struct AA { int a_int; unsigned a_unsigned_int; float a_float; double a_double; bool a_bool; //--------------------------------------------- // for testing method calling and overloading int multiply_( int a ) { cout << " multiply_( int ) " << endl; return a*a_int; } double multiply_( double a ) { cout << " multiply_( double ) " << endl; return a * a_double; } int times_ten( int x ) { return x*10; } static int times_ten_static( int x ) { return x*10; } int method_with_default_pars( int a, int b=3, int c = 7 ) { return a_int + a + b ; } int funki( int a ) { cout << "###############################################################" << endl; cout << "funkd called with a=" << a << " and this=" << this << endl; cout << "this->a_int = " << a_int << endl; cout << "###############################################################" << endl; return a * a_int; } int funkd( double x ) { cout << "###############################################################" << endl; cout << "funkd called with x=" << x << " and this=" << this << endl; cout << "this->a_int = " << a_int << endl; cout << "###############################################################" << endl; return (int) x; } void cheet() { cout << this << " " << (long) this << endl; } };