c struct problems???

Associate
Joined
10 Feb 2004
Posts
198
Can anyone help me out on this?

I've defined a structure in c with the following......

struct mystructure
{
unsigned char single_char;
unsigned char array_char[2];
};


so far so good. but then i come to create and initialise one with this.....

static struct mystructure fristinstance = {1,2,3};

that gives me 2 warnings.....
1. near initialization for 'firstinstance.array_char'
2. missing braces around initializer

just out of interest the following is compiled without complaint....
static struct mystructure fristinstance = {1};

anyone??
 
matja, your an absolute star! been struggling with that for ages. now i can enjoy my weekend without a worry :-)
 
Back
Top Bottom