If a header file is included twice by mistake in the program, will it give any error?



If a header file is included twice by mistake in the program, will it give any error?..

Answer / Vikash Rai

Yes, including a header file twice in a program can result in multiple definition errors if the same function or variable is defined in both instances. To avoid this, use 'include guards' to prevent the repeated inclusion of the header files.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is meant by a delegate?

1 Answers  


Definition of class?

12 Answers  


What is flush () in c++?

1 Answers  


What are inline functions?

3 Answers   Fidelity, Verizon,


please help to write the code of chess game in c++??????????

1 Answers   NEC,


what is pre-processor in C++?

1 Answers  


Why do we use double in c++?

1 Answers  


Explain all the C++ concepts using examples.

1 Answers   InterGraph,


How does the copy constructor differ from the assignment operator (=)?

1 Answers  


Why pointer is used in c++?

1 Answers  


Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

1 Answers  


How to declare a pointer to an array of integers?

1 Answers  


Categories