multiple inclusion of header files in c:
How to avoid the problem of multiple inclusion of same header file?
it can't be resolved in C. It is the problem.
Use #ifndef macro technique as the first line in the header file..
Use reverse engineering technique by opening all the files and manually check if any duplicated header files are included.
C pre processor will automatically put a check to see if any header files are repeatedly included in any header or c source files. if there are any c pre processor will automatically remove.
//assume that header file name is test.h
//below header file will avoid multiple inclusion problem.
void fun(int i);
Back To Top