93.9k views
0 votes
Which of the following is a directive used to create an "include guard" that allows a program to be conditionally compiled to prevent a header file from accidentally being included more than once?(A) #include(B) #guard(C) #ifndef(D) #endif(E) None of these

User BeeOnRope
by
7.6k points

1 Answer

0 votes

Answer:C) #ifndef

Explanation: #ifndef is the directive used in the C++ for the inclusion of the guard in the program .This directive basically checks whether the compilation is condition based. It also takes the note about whether the statement is earlier included or defined macro .

Other given option are incorrect because #include is for the including of the header files, # guard is not a defined directive and #endif is the directive for the ending of the function. Thus the correct option is option(C)

User Mbelsky
by
6.9k points