init of multdim array of structs...

Discussion in 'C Programming' started by Tony Adams, Sep 20, 2004.

  1. Tony Adams

    Tony Adams Guest

    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
     
    Tony Adams, Sep 20, 2004
    #1
    1. Advertisements

  2. Tony Adams

    Tony Adams Guest

    forget about this - it is correct. it was something else that made my
    comoiler scream...
    sorry!
     
    Tony Adams, Sep 20, 2004
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.