Home / C/C++ / How does “#include” keyword work?

How does “#include” keyword work?

Have you ever wondered : 

.#include meaning?

.what is “#include” keyword?

.How does #include work?

we will discuss it.


#: is a pound sign which helps to pre-process the program before the compilation

include: is a simple directive that tells pre-processor to include the library’s data(i.e. function declarations)


in fact,

 The content of “file-name” or “header” will be copy and paste at position using include keyword. We will add 2 examples to clarify.

example 1:

example 2:

  • Once-Only Headers

If a header file happens to be included twice, the compiler will process its contents twice and it will result in an error. The standard way to prevent this is to enclose the entire real contents of the file in a conditional, like this-


About admin

Check Also

[ SC Tutorial ] 3. SystemC Data types

SystemC has a number of predefined data types to support hardware designs spanning from the …


  1. Thank you from the bottom of my heart for everything

  2. I really appreciate your help with my project!

  3. I’m grateful for having you as a friend!

  4. There are no words to show my appreciation!

  5. I every time spent my half an hour to read this weblog’s content daily along with a cup of

  6. Articles created by an expert. It is great to visit your website. I intellectual a lot of knowledge here.

Leave a Reply

Your email address will not be published. Required fields are marked *