[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CCPlusPlusInclude
Displaying differences between revision 6 and the latest revision
= #include =¶
¶
A preprocessor statement to add a header file (.h or .hpp) or other files to your program.¶
¶
There are three different header file #includes:¶
¶
[code]¶
#include <iostream> // 1: STL¶
#include <assert.h> // 2: The standard header file directory¶
#include "Unit1.h" // 3: Local¶
[/code]¶
¶
The first, without the .h extension, means that this header file is from the Standard Template Library.REMOVE ¶
TheME! secMond #include means that thve header is not from the [[CppSTL | STL]] but in the standard header file directory. ¶
The third #include means that the file is local, i.e. in the same directory/folder as the program. If the local #include fails, the standard header file directory is checked for this header file.¶
¶
== Implementation (.c or .cpp) files ==¶
These normally are not #included.Instead, these are added to your project. For example, in [[CppBuilder | C++ Builder]], select 'Project | Add to Project'.¶
¶
Forgetting to add an implementation file to you project results in a linking error</b></strike></font>.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CCPlusPlusInclude
Displaying differences between revision 6 and the latest revision
¶
A preprocessor statement to add a header file (.h or .hpp) or other files to your program.¶
¶
There are three different header file #includes:¶
¶
[code]¶
#include <iostream> // 1: STL¶
#include <assert.h> // 2: The standard header file directory¶
#include "Unit1.h" // 3: Local¶
[/code]¶
¶
The first, without the .h extension, means that this header file is from the Standard Template Library.
The
The third #include means that the file is local, i.e. in the same directory/folder as the program. If the local #include fails, the standard header file directory is checked for this header file.¶
¶
== Implementation (.c or .cpp) files ==¶
These normally are not #included.
¶
Forgetting to ad
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
