I'm building a main.c file to make use of functions out of a few different .h files. A few of those .h files (or rather, their .c source files) use the same includes (the standard but also some others like )
My question is: Is it okay if I just include those once for all header files in my main.c, or should I let every .h file include them individually and not include them in my main.c (considering I only use functions from those header files)?
Or should I do both?
How I do it now is:
dist.c:
#include "dist.h"
#include <stdio.h>
#include <unistd.h>
#include "rpiGpio.h"
#include <pthread.h>
#include <wiringPi.h>
#include <softPwm.h>
Then for another:
cmps.c:
#include "cmps.h"
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include "rpiGpio.h"
Then in my main.c:
#include <stdio.h>
#include <stdlib.h>
#include "dist.h"
#include "cmps.h"
Thanks in advance!