I have a program with several .c and .h files.
In one of the .c files I am using the function strcmp(). I am adding in this file the header for string.h
Is the string.h header in the file with the function main also required?
If the translation unit containing the function main does not use the function strcmp or any other declaration from the header <string.h> then inclusion of the header in this translation unit is redundant and only confuses readers.
If the translation unit containing the function main does not use the function
strcmp
or any other declaration from the header<string.h>
then inclusion of the header in this translation unit is redundant and only confuses readers.