How do you check if a header file is included?
Answer
To check if an header file has been included or not in a C or C++ code, we need to
check if the macro defined in the header file is being defined in the client code. Standard header files like math. h have their own unique macro (like _MATH_H ) which we need to check. Consider this example of checking if math.
Answer
To check if an header file has been included or not in a C or C++ code, we need to
check if the macro defined in the header file is being defined in the client code. Standard header files like math. h have their own unique macro (like _MATH_H ) which we need to check. Consider this example of checking if math.