#include #include using namespace std; class announcer { int i; public: announcer(int initial_i); announcer(const announcer& another); ~announcer() {cout << "dying holding " << i << "\n";} void increment() {++i;} //inline member function }; announcer::announcer(int initial_i) : i {initial_i} { cout << "born holding " << i << "\n"; } announcer::announcer(const announcer& another) : i {another.i} { cout << "born holding a copy of another object's " << i << "\n"; } void f(announcer arg1, announcer& arg2, const announcer& arg3); //func declarat int main() { announcer a1 {10}; announcer a2 {20}; announcer a3 {30}; f(a1, a2, a3); //Creates a copy of a1, but not of a2 and a3. cout << "We have returned from the function f.\n"; return EXIT_SUCCESS; } void f(announcer arg1, announcer& arg2, const announcer& arg3) //func definition { cout << "The function f has been called.\n"; arg2.increment(); //f can change the value of a2, but not a1 or a3 }