User Program Communication

Including Header Files in C++

A C++ program can include header files. They are used to provide either an interface, which gives function prototypes for definition, or to provide pre-defined definitions.


Syntax
//for standard system header files, like stdio.h. Will search standard system directories
#include <file> 
 
//for header files built by the user, within the source code's directory
#include "file"

Notes

These header files are included and compiled by the preprocessor.


Example
#include <stdio.h>
#include "myHeader.h"

See Also
Documentation

Headers and Includes - C++ Forum

Add to Slack

< Commenting   |   Namespaces >

© 2019 SyntaxDB. All Rights Reserved.