Aşağıdaki şekilde yapabilirsiniz:
struct Coordinate {
int x, y;
};

class test
{
private:
Coordinate coordinate;
public:
void setX(int x) { coordinate.x = x; };
void setY(int y) { coordinate.y = y; };
void setXY(int x, int y) { coordinate = { x,y }; };
int getX() { return coordinate.x; };
int getY() { return coordinate.y; };
Coordinate getXY() { return coordinate; };
};
Test için:

#include "test.h"
...
void main(){
test t;
t.setX(10);
t.setY(11);
std::cout << "X:" << t.getX() << std::endl;
std::cout << "Y:" << t.getY() << std::endl;
    std::cout << "X and Y : " << t.getXY().x << "," << t.getXY().y<<std::endl;
}