[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
The
ME! 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 ad
d an implementation file to you project results in a linking error</b></strike></font>.



last edited (May 12, 2006) by bilderbikkel, Number of views: 13604, Current Rev: 7 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.