1. The code
is illegal, so the program did not compile, and execution cannot happen.Code:
myObj = new object_type();
2. In myFunctionReference, no copying is performed by the call. The assignment operator is called inside the function. In myFunctionArgument, arg1 is constructed "during" the function call (i.e., before the flow of control is handed off to the function), then myObj is changed by the assignment operator, then arg1 is destructed before flow of control returns to the caller.