What is the purpose of wrapping a header file in #ifndef MYHEADER_H, #define MYHEADER_H and #endif?
Correct answer B. To stop the header's contents being processed more than once in a translation unit
Explanation
This is an include guard. The first inclusion defines MYHEADER_H, so if the header is included again, directly or through another header, the #ifndef test fails and the contents are skipped. That prevents errors such as a struct being defined twice. Many compilers also support the non-standard #pragma once for the same purpose.
Answer checked How we write and check questions
Discussion