This is happening because you are passing the arguments to setval
function by value which will modify the copy of the object that you have passed.
Use the following signature instead:
void setval(xyz& v1, int v11, abc& v2, int v22);
This way you will be sending the reference to your objects instead of copies of those objects made in some separate blobs of memory. Thus, the objects created in your main function will be assigned the values.