This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Extern STRUCT..

Hi, I have a big problem. I have a multyple file included into the project, and in the main.c i've declared a struct like this:

struct{
unsigned char x;
unsigned char y;
unsigned char z;
}prova;


My problem is, how can i use this struct on other file included? ("extern struct.... not work").
The compiler return error L6200E.
Help me,Thanks!.

Parents
  • typedef struct tagStructName{
     ...
    }STRUCTNAME;
    

    Then anyway, where you normally needed to write "struct tagStructName", you can now write more shortly just "STRUCTNAME".

    Be aware, though, that it's generally considered a bad idea in C programs to name anything that's not a preprocessor or possibly an enum tag in ALL_CAPITALS.

Reply
  • typedef struct tagStructName{
     ...
    }STRUCTNAME;
    

    Then anyway, where you normally needed to write "struct tagStructName", you can now write more shortly just "STRUCTNAME".

    Be aware, though, that it's generally considered a bad idea in C programs to name anything that's not a preprocessor or possibly an enum tag in ALL_CAPITALS.

Children