What is wrong in the below code,
I get the 2 error when i compile the prog... what is mean ??
error C2275: structure: illegal use of this type as an expression
error C2065: str: undeclared identifier
int func(structure *Type,
int main(int argc, char **argv )
error = func(&str, "abc.txt");
Priya Mishra wrote:
> What is wrong in the below code,
> I get the 2 error when i compile the prog... what is mean ??
It means that you have not posted code that exhibits the problem you are
> error C2275: structure: illegal use of this type as an expression
This error does not match the problems in you code, therefore was
probably caused by something you have not posted.
> error C2065: str: undeclared identifier
This error was probably a knock on effect of the first error.
> typedef struct
> char file;
> int a;
> int b;
> int c;
> } structure;
Very bad naming, use names that actually mean something.
> int func(structure *Type,
> char *file_Name);
Even worse naming.
> int main(int argc, char **argv )
> int error;
> structure *str;
> error = func(&str, "abc.txt");
This is an error, but not the one your compiler is complaining about.
You have declared str as being a pointer to structure which is what func
expects, but you are passing the address of it.
> return error;
In future, please ensure the code you post actually exhibits the problem
you are asking about. Also, if the problem is a compiler diagnostic tell
us which line of code it is complaining about.
Living in interesting times.
Although my email address says spam, it is real and I read it.
|All times are GMT. The time now is 04:58 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.