tags:

views:

138

answers:

2

Possible Duplicate:
typedef stuct problem in C

Hello there

I am facing I have defined I a structure in a C header file:

typedef struct iRecActive{

    char iRecSID[32];
    unsigned char RecStatus;
    int curSel;

}iRecAcitve_t;

but when I use the same structure in another file, the compiler gives some error:

error C2275: 'iRecActive_t' : illegal use of this type as an expression d:\project\project original\mirec2pc v1.0\httpapp\httpapplication.h(15) : see declaration of 'iRecActive_t'

I would be obliged if anyone could help me out

Regards

Umair

+1  A: 

Well, you could check you spelling, both in the question and in the code. You seem to have declared it as iRecAcitve_t but use iRecActive_t

Christoffer
well. I am sorry that I haven't corrected the spelling in the question but I have already changed it in my code. But after changing the spelling the compiler recognizes iRecActive_t; as a structure but give that particular error. I am still clueless why is the compiler doing that ?
Omayr
+1  A: 

It means that you've used the typename where the compiler expects...something else.

For example:

iRecActive_t *thing = iRecActive_t; // compiler expects new iRecActive_t()

if (iRecActive_t) {} // compiler expects an expression

As others have said, you need to post the line it's complaining about (line 15 of httpapplication.h)

Edit

iRecActive_t iRecActiveObj[4]; appears to be legal, in which case it's probably the line before that's got the compiler confused. For example:

if (thingOne ==                     // oops
    iRecActive_t iRecActiveObj[4];
egrunin
iRecActive_t iRecActiveObj[4];this is the line for which compiler is showing the respective error
Omayr