Description of the problem
I am wondering about the "right way" to define structs in C to use them by other source files. Think about the following struct
struct f3{
double x;
double y;
double z;
};
Question
Should typedefs and structs be declare in a header file or source file? If in a header file, what should be included in that header file in order to comply with the C software engineering techniques?
What I have done so far:
I could place it in types.h
and then use struct f3
in other source files (#include types.h
) or it could be placed in the source file type.c
.