Suppose I want a program that uses a struct author. As I plan to make a big program, I want to organise it in different files:
test.c will contain the main(), and will make use of the struct author
author.h will contain the struct declaration and function declarations that work with author objects.
author.c will contain the function implementations.
So, the main file (test.c) will #include "author.h"
My problem is that when I run this code, I won't work unless I put the struct declaration in both author.h and author.c:
What am I overlooking?Code:struct author { /*members go here*/ }; typedef struct author author;
Or is this the wrong way to organise a program?



LinkBack URL
About LinkBacks



