Mail Archives: djgpp/1998/03/09/18:49:26
At 12:50 3/8/1998 +0100, Andreas 'LionKing' Tscharner wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>
>Hello World,
>
>I have the following problem:
>
>DIALOG *MyDialog;
>
>MyDialog = new DIALOG[n];
>MyDialog[0] = {d_shadow_box_proc, x, .....};
>
>The compiler says "Parse error before '{'". What's the problem? How do I
>fix it?
Flame me if I'm wrong, but I don't think you can initialize a dynamic struct
like that. In fact, I don't think standard C/C++ lets you do it at all.
Either you can initialize it one field at a time:
MyDialog[0].foo = d_shadow_box_proc;
MyDialog[0].bar = x;
Or you can use a GNU extension (see info node "Constructor Expressions"):
MyDialog[0] = ((DIALOG) {d_shadow_box_proc, x, ...});
Hope this helps.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -