Some questions regarding efficient coding style using C:
I'm working on 8-bit PIC controllers using C. I would like to know certain things about coding style and structure.
I have read that keeping one header file is good programming style. But for segmenting functions rather easily for debugging and future development, can we keep more than 2 header files? Or, is it error prone? I trust creating header files and declaring function prototypes will remove the
extern
declaration in each related source files by doing so. (i.e. eeprom.h, data.h)Is it a good practice to keep all variables in a separate header file? Also, how do you deal with variables that are needed in more than one source file?