|
INTERVIEW QUESTIONS
MICROSOFT
VC++
DETAILS
Question: What You Should Include in a Header File
Answer: August 30th, 2009 by sd | Posted in Uncategorized
A header file should begin and end with #include guards to guarantee that it’s not #included more than once during the same compilation session. A typical #include guard looks as follows: // from stdlib.h #ifndef STDLIB_INCLUDED // included for the first time? #define STDLIB_INCLUDED
// declarations, typedef’s etc.
#endif // close #include guard at the end of the file
Inside the header file, you may insert function prototypes, structs declarations, #define macros, enum types, typedef’s, class declarations, extern declarations of global objects, template classes and functions, constants, certain #pragma directives that control the compilation process and similar macro directives. Note, however, that a header file should never have definitions (except for macros and templates). In other words, you shouldn’t implement functions and class member functions inside a header file (except for inline functions), nor should you create variables, arrays, and object or global variables in a header file. VC++ FAQ’s And Interview Questions and Answers
Popularity: 6% [?]
|
|
|
Category |
VC++ Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8200 users |
Added on |
9/1/2014 |
Views |
66080 |
Rate it! |
|
|
Question:
What You Should Include in a Header File
Answer:
August 30th, 2009 by sd | Posted in Uncategorized
A header file should begin and end with #include guards to guarantee that it’s not #included more than once during the same compilation session. A typical #include guard looks as follows: // from stdlib.h #ifndef STDLIB_INCLUDED // included for the first time? #define STDLIB_INCLUDED
// declarations, typedef’s etc.
#endif // close #include guard at the end of the file
Inside the header file, you may insert function prototypes, structs declarations, #define macros, enum types, typedef’s, class declarations, extern declarations of global objects, template classes and functions, constants, certain #pragma directives that control the compilation process and similar macro directives. Note, however, that a header file should never have definitions (except for macros and templates). In other words, you shouldn’t implement functions and class member functions inside a header file (except for inline functions), nor should you create variables, arrays, and object or global variables in a header file. VC++ FAQ’s And Interview Questions and Answers
Popularity: 6% [?] Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All VC++ Interview Questions & Answers - Exam Mode /
Learning Mode
|