- 556 名前:はちみつ餃子 ◆8X2XSCHEME mailto:sage [2012/04/17(火) 20:30:51.83 ]
- >>555
一般的な感覚だと struct hoge* initial_main(void) { struct hoge* hog = malloc(sizeof(struct hoge)); hog->A = malloc(sizeof(struct sub)*(2)); hog->B = malloc(sizeof(struct sub)*(4)); hog->C = malloc(sizeof(struct sub)*(8)); hog->C[5].a = 100; return hog; } と定義しといて、 呼出す側は hog=initial_main(); じゃないかなぁ。
|

|