![](/img/trans.png)
[英]How to initialize a structure member of a union inside a structure in C++?
[英]How to make a C++ structure contain other structure as member variable
我想知道如何在來自另一個結構的結構中定義變量。 例如:
struct Date
{
int month;
int day;
int year;
};
struct Profile
{
START DATE
END DATE
int hours_worked
etc...
};
struct Profile {
Date start;
Date end;
// etc...
};
這就是你想要的嗎? 如果是這樣,我強烈建議手頭准備一本教科書,而不是成為C ++問題的入門者,直到您經驗豐富為止。 如果沒有,請更新您的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.