I think, it better if you get some more knowledge regarding class design.
So i prefer you to have a look with some book in C++ like C++ Primer from Stanley B Lippman.
Well see your case
class B
{
public:
void SetAVal( int X1, int Y1 )
{
LocalX = X1;
LocalY = Y1;
}
private:
int LocalX, LocalY;
};
Class A {
int x, y;
void SetValTOB()
{
b.SetAVal( x, y );
}
B b;
}