I am confused about the usage of helpers.h and declaring the functions in it. As I can from the beginning include the bmp.h in the helpers.c and create the functions in the helpers.c.

1 Answer 1


A header file becomes more important the larger a project is. The more some code needs to know a little bit about other code, but not every detail.
The helpers.h file in included in filter.c as well as helpers.c. Each of these c files is compiled independently. The header file is used by filters.c to know what is implemented in helpers.c.
Run this experiment:Remove the helpers.h file from filters.c. This will not compile. Include the bmp.h file in filter.c, to fix a few of the errors. Look at the remaining compile errors.
All the files could be in 1 larger file, would compile fine. It's preferable to keep the parts you are implementing apart from the provided filter code, and both of these apart from the information in bmp.h, which is industry standard. As projects get bigger, and more people are working together, this separation makes things easier.

  • Thanks so much. I got it.
    – Aya Othman
    Mar 3, 2021 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .