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!.
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.
You can principally skip the "tagStructName". But to my experience then sometimes debugger / watch windows get problems - so better give a unique name to every struct you define.