4

I see many programmers that include "utils.h" to their program. Tried to search for what it is exactly and what is the proper use of utils.h, but all I found was different versions of the file. So what is it exactly?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
yaloner
  • 715
  • 2
  • 6
  • 19

2 Answers2

6

Many programmers define common functionalities in utils.c and declare them in utils.h . You could implement for example command line parsing methods in utils.h / utils.c.

But utils.h is no standard file to be included.

VAndrei
  • 5,420
  • 18
  • 43
4

The " mark instead of < mark in #include "utils.h" is a bit of a clue. If it had been

#include <utils.h> 

it is likely that utils.h is a general utility header. But being #include "abc" means it is specific to project and utils.h is likely in the same folder as other source files for the project.

Most likely utils.h is VERY project specific and contains helper function for the project

Angus Comber
  • 9,316
  • 14
  • 59
  • 107
  • Nice answers here (https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename) about #include vs #include "filename". – Hari Jul 29 '22 at 11:12