c - Header per source file -
I am trying to understand the purpose behind each header file method for the purpose behind a header. As I see it, header functions are to declare announcements, typedef
and macros among many files that they use when you use your .c
file If you create a header file for it, it is a loss, every time you want to see a function declaration or macro, you need to refer to the header file, and generally it is simple that everything
Then the programmer Why do you use the method?
Definitions (which should be in one place) Header files in different announcements (that is, each C file should be available). In addition, they provide a bit of humility, because you can only put the public interface in the header file, and can not specify functions and static variables that are C should be internal in the file. It uses a public interface and file system to provide private implementation.
One. In this way, you know that announcements are in .h file, and definitions in the related file.
Comments
Post a Comment