我正在创建一个简单的对象......但是
我找不到一种“语义方式”来创建一个对象,该对象具有一个带有构造函数的类作为数据,所以我无法创建我的对象,即:
#include <iostream>
using namespace std;
class Coordinate
{
public:
Coordinate(int axisX,int axisY) {
x= axisX;
y= axisY;
}
int x,y;
};
class Point
{
public:
string color;
Coordinate coordinate;
};
int main()
{
Point myPoint; //Error here also tried Point myPoint(1,1) or myPoint::Coordenate(1,1) etc...
return 0;
}