The real question is what to put in "something.c" and what 
to put in the corresponding "something.h".

Personally I regard the header file "something.h" as a 
public interface to the code in "something.c". Therefore it 
contains function prototypes for public (non-static) 
functions, as well as constants and external variables, 
anything that a user needs to know, together with comments 
saying what they're for and how to use them.

Anything the user doesn't need to know goes into 
"something.c". In my case this usually consists mainly of 
function definitions.

This is my attempt to draw a line between public and 
private, i.e. encapsulation.

David

Reply via email to