init of multdim array of structs...

T

Tony Adams

Hi,
isn't this corretc way to initialize a multi-dimensional array of structs in
C?!?

typedef int (*func)(int);

typedef struct {
int state;
func f;
};

cnt table[2][2] = {
{{CLOSED,&f1},{OPEN,&noop}},
{{ILLEGAL,&illegal},{OPEN,&f2}}
};

(where CLOSED, f1, etc... are defined as ints and funcs.)

TonyA
 
T

Tony Adams

forget about this - it is correct. it was something else that made my
comoiler scream...
sorry!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top