I organized my program splitting every entity in its own file. Which is something like this.
main.c
#include "student.h"
#include "subject.h"
#include "classroom.h"
#define PI 3.14
int sum(int a, int b);
student.h
typedef struct st student;
student.c
#include "student.h"
subject.h
typedef struct sb subject;
subject.c
#include "subject.h"
classroom.h
typedef struct cr classroom;
classroom.c
#include "classroom.h"
My problem is, inside classroom I need student and subject. How should I include this? should I include this inside classroom.h or classroom.c?
#include "student.h"
#include "subject.h"
Second, I have things on main.c that are used by all of then like sum() and PI
How it is the right way including implementation in the header or including header in the implementation file? and should I include the header or implementation files?
If I throw everything on a single file it compiles just fine, but I'm not doing this right it does not compile.