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?
Asked
Active
Viewed 1.8k times
4
-
10It is just a short version of `#include "cant-think-of-a-better-name.h"` – Hans Passant Oct 11 '14 at 10:25
-
Iit's just a name, like include "common.h" or whatever name you can use for your file and unused by standard libraries. – Marian Oct 11 '14 at 10:26
2 Answers
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