我想知道如何在来自另一个结构的结构中定义变量。例如:
struct Date
{
int month;
int day;
int year;
};
struct Profile
{
START DATE
END DATE
int hours_worked
etc...
};
答案 0 :(得分:4)
struct Profile {
Date start;
Date end;
// etc...
};
这就是你想要的吗?如果是这样的话,我强烈建议您手头有一本教科书,而不是SO是C ++问题的首选,直到您更加经验丰富。如果没有,请更新您的问题。