In <beht72$erp$03$> "Andi.Martin" <> writes:
>how is it possible, to only initialize parts of a structure.
>
>Example:
>
>typedef struct{
> int a, b;
> ... (huge lot of members);
> double x,y;
>}_s;
>
>_s s={a=10,x=23.0};
>
>
>This shall be done BEFORE any code is executed! I mean no initialize
>functions!
>
>Anyone an idea?
If you need a portable solution, your only chance is to put the members
that need initialisation at the beginning on the structure:
struct {
int a;
double x;
... (huge lot of members);
} s = {10, 23.0};
The members without an explicit initialiser will be initialised to the
right type of zero.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: