Passing arguments by reference in c++