What is an inclusion guard?



What is an inclusion guard?..

Answer / Ankit Porwal

An inclusion guard is a mechanism used to prevent multiple inclusions of the same header file in a C++ program. It consists of preprocessor directives that check whether the header file has already been included, and if it has not, include the contents of the header file. Inclusion guards typically use conditional compilation to avoid multiple inclusions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

class professor {}; class teacher : public virtual professor {}; class researcher : public virtual professor {}; class myprofessor : public teacher, public researcher {}; Referring to the sample code above, if an object of class "myprofessor" were created, how many instances of professor will it contain? a) 0 b) 1 c) 2 d) 3 e) 4

4 Answers   Quark,


Explain linear search.

1 Answers  


Can circle be called an ellipse?

1 Answers  


Do you know about latest advancements in C++ ?

1 Answers   Agilent, ZS Associates,


What does flush do?

1 Answers  


What is c++ in english?

1 Answers  


What is problem with overriding functions?

1 Answers  


Write a C++ program that asks the user to choose a number between 1 and 1000. Then, your program should be able to guess the number by asking the user no more than 10 yes/no questions. Use a while loop in your program

1 Answers  


Differentiate between late binding and early binding. What are the advantages of early binding?

1 Answers  


Is python written in c or c++?

1 Answers  


What is a template in c++?

4 Answers  


What do you mean by function pointer?

1 Answers  


Categories