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?
Thanks!
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?
Thanks!
Copyright © 2021 Jogjafile Inc.
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.