The first two arguments must be passed by reference.
The second two could be passed by value or constant reference to guarantee that the third and fourth arguments are not changed
void setBoth(int& aval, int& bval, int xval, int yval); or void setBoth(int& aval, int& bval, const int& xval, const int& yval);