Инструкция include как выполняется кем выполняется

From Wikipedia, the free encyclopedia

Many programming languages and other computer files have a directive, often called include, import, or copy, that causes the contents of the specified file to be inserted into the original file. These included files are called header files or copybooks. They are often used to define the physical layout of program data, pieces of procedural code, and/or forward declarations while promoting encapsulation and the reuse of code or data.

[edit]

In computer programming, a header file is a file that allows programmers to separate certain elements of a program’s source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers. Programmers who wish to declare standardized identifiers in more than one source file can place such identifiers in a single header file, which other code can then include whenever the header contents are required. This is to keep the interface in the header separate from the implementation.
[1]

The C standard library and the C++ standard library traditionally declare their standard functions in header files.

Some recently created compiled languages (such as Java, C#) do not use forward declarations; identifiers are recognized automatically from source files and read directly from dynamic library symbols. This means header files are not needed.

Purpose[edit]

The include directive allows libraries of code to be developed which help to:

  • ensure that everyone uses the same version of a data layout definition or procedural code throughout a program,
  • easily cross-reference where components are used in a system,
  • easily change programs when needed (only one file must be edited), and
  • save time by reusing data layouts.

Example[edit]

An example situation which benefits from the use of an include directive is when referring to functions in a different file. Suppose there is some C source file containing a function add, which is referred to in a second file by first declaring its external existence and type (with a function prototype) as follows:

int add(int, int);

int triple(int x)
{
    return add(x, add(x, x));
}

One drawback of this approach is that the function prototype must be present in all files that use the function. Another drawback is that if the return type or arguments of the function are changed, all of these prototypes would need to be updated. Putting the prototype in a single, separate file avoids these issues. Assuming the prototype is moved to the file add.h, the second source file can then become:

#include "add.h"

int triple(int x)
{
    return add(x, add(x,x));
}

Now, every time the code is compiled, the latest function prototypes in add.h will be included in the files using them, avoiding potential errors.

Language support[edit]

C/C++[edit]

In the C and C++ programming languages, the #include preprocessor directive causes the compiler to replace that line with the entire text of the contents of the named source file (if included in quotes: «») or named header (if included in angle brackets: <>);[2] note that a header doesn’t need to be a source file.[3] Inclusion continues recursively on these included contents, up to an implementation-defined nesting limit. Headers need not have names corresponding to files: in C++ standard headers are typically identified with words, like «vector», hence #include <vector>, while in C standard headers have identifiers in the form of filenames with a «.h» extension, as in #include <stdio.h>. A «source file» can be any file, with a name of any form, but is most commonly named with a «.h» extension and called a «header file» (sometimes «.hpp» or «.hh» to distinguish C++ headers), though files with .c, .cc, and .cpp extensions may also be included (particularly in the single compilation unit technique), and sometimes other extensions are used.

These two forms of #include directive can determine which header or source file to include in an implementation-defined way. In practice, what is usually done is that the angle-brackets form searches for source files in a standard system directory (or set of directories), and then searches for source files in local or project-specific paths (specified on the command line, in an environment variable, or in a Makefile or other build file), while the form with quotes does not search in a standard system directory, only searching in local or project-specific paths.[4] In case there is no clash, the angle-brackets form can also be used to specify project-specific includes, but this is considered poor form. The fact that headers need not correspond to files is primarily an implementation technicality, and is used to omit the .h extension in including C++ standard headers; in common use, «header» means «header file».

For example:

#include <stdio.h>  // Include the contents of the standard header 'stdio.h' (probably a file 'stdio.h').
#include <vector>  // Include the contents of the standard header 'vector' (probably a file 'vector.h').
#include "user_defined.h"  // Include the contents of the file 'user_defined.h'.

In C and C++, problems may be faced if two (or more) include files contain the same third file. One solution is to avoid include files from including any other files, possibly requiring the programmer to manually add extra include directives to the original file. Another solution is to use include guards.[5]

COBOL[edit]

COBOL (and also RPG IV) allows programmers to copy copybooks into the source of the program in a similar way to header files, but it also allows for the replacement of certain text in them with other text. The COBOL keyword for inclusion is COPY, and replacement is done using the REPLACING ... BY ... clause. An include directive has been present in COBOL since COBOL 60, but changed from the original INCLUDE[6] to COPY by 1968.[7]

Fortran[edit]

Fortran does not require header files per se. However, Fortran 90 and later have two related features: include statements and modules. The former can be used to share a common file containing procedure interfaces, much like a C header, although the specification of an interface is not required for all varieties of Fortran procedures. This approach is not commonly used; instead, procedures are generally grouped into modules that can then be referenced with a use statement within other regions of code. For modules, header-type interface information is automatically generated by the compiler and typically put into separate module files, although some compilers have placed this information directly into object files. The language specification itself does not mandate the creation of any extra files, even though module procedure interfaces are almost universally propagated in this manner.

Pascal[edit]

Most Pascal compilers support the $i or $include compiler directive, in which the $i or $include directive immediately follows the start of a comment block in the form of

  • {$i filename.pas}
  • (*$I filename.inc*)
  • {$include filename.inc}
  • (*INCLUDE filename.pas*)

Where the $i or $include directive is not case sensitive, and filename.pas or filename.inc is the name of the file to be included. (It has been common practice to name Pascal’s include files with the extension .inc, but this is not required.) Some compilers, to prevent crock recursion, limit invoking an include file to a certain number, prohibit invoking itself or any currently open file, or are limited to a maximum of one include file at a time, e.g. an include file cannot include itself or another file. However, the program that includes other files can include several, just one at a time.

PHP[edit]

In PHP, the include directive causes another PHP file to be included and evaluated.[8] Similar commands are require, which upon failure to include will produce a fatal exception and halt the script,[9] and include_once and require_once, which prevent a file from being included or required again if it has already been included or required, avoiding the C’s double inclusion problem.

Other languages[edit]

There are many forms of the include directive, such as:

  • include ... (Fortran, MASM)
  • <!--#include ... --> (HTML SSI)
  • import ...; (Java)
  • import ... from ... (JavaScript as in ECMAScript)
  • var ... = require("...") (JavaScript with CommonJS)
  • <%@ include ... %> (JSP)
  • {$I ...} (UCSD Pascal, Turbo Pascal)
  • %include ... (PL/I)
  • import ... (Python)
  • /COPY QCPYLESRC,QBC (RPG IV – first argument is the filename, second argument is the copybook)
  • use ...; (Rust)
  • using ...; (C#)
  • local ... = require("...") (Lua)
  • import ...; (D)

Modern languages (e.g. Haskell and Java) tend to avoid copybooks or includes, preferring modules and import/export systems for namespace control. Some of these languages (such as Java and C#) do not use forward declarations and, instead, identifiers are recognized automatically from source files and read directly from dynamic library symbols (typically referenced with import or using directives), meaning header files are not needed.

See also[edit]

  • Application programming interface (API)
  • Precompiled header
  • Subroutine
  • Modular programming
  • #pragma once
  • Header-only
  • Unity build
  • Transclusion
  • File inclusion vulnerability
  • One Definition Rule (ODR)
  • Interface Definition Language (IDL)
  • Class implementation file

References[edit]

  1. ^
    Alan Griffiths (2005). «Separating Interface and Implementation in C++». ACCU. Retrieved 2013-05-07.
  2. ^ C11 standard, 6.10.2 Source file inclusion, pp. 164–165
  3. ^ C11 standard, 7.1.2 Standard headers, p. 181, footnote 182: «A header is not necessarily a source file, nor are the < and > delimited sequences in header names necessarily valid source file names.
  4. ^ Stallman, Richard M. (July 1992). «The C Preprocessor» (PDF). Archived from the original (PDF) on 4 September 2012. Retrieved 19 February 2014.
  5. ^ Pike, Rob (21 Feb 1989), Notes on programming in C, Cat-v document archive, retrieved 9 Dec 2011
  6. ^ «COBOL Initial Specifications for a COmmon Business Oriented Language» (PDF). Department of Defense. April 1960. p. IX-9. Archived from the original (PDF) on 12 February 2014. Retrieved 11 February 2014.
  7. ^ «The COPY Statement». CODASYL COBOL Journal of Development 1968. July 1969. LCCN 73601243.
  8. ^ «include». php.net. The PHP Group. Retrieved 20 February 2014.
  9. ^ «require». php.net. The PHP Group. Retrieved 20 February 2014.

External links[edit]

  • Organizing Code Files (the potential pitfalls and guidelines for using header files in C++)
  • C++ header file inclusion rules
 

Препроцессор — это специальная программа, являющаяся частью компилятора языка Си. Она предназначена для предварительной обработки текста программы. Препроцессор позволяет включать в текст программы файлы и вводить макроопределения.
Работа препроцессора осуществляется с помощью специальных директив (указаний). Они отмечаются знаком решетка #. По окончании строк, обозначающих директивы в языке Си, точку с запятой можно не ставить.

Основные директивы препроцессора

#include — вставляет текст из указанного файла
#define — задаёт макроопределение (макрос) или символическую константу
#undef — отменяет предыдущее определение
#if — осуществляет условную компиляцию при истинности константного выражения
#ifdef — осуществляет условную компиляцию при определённости символической константы
#ifndef — осуществляет условную компиляцию при неопределённости символической константы
#else — ветка условной компиляции при ложности выражения
#elif — ветка условной компиляции, образуемая слиянием else и if
#endif — конец ветки условной компиляции
#line — препроцессор изменяет номер текущей строки и имя компилируемого файла
#error — выдача диагностического сообщения
#pragma — действие, зависящее от конкретной реализации компилятора.

Директива #include

Директива #include позволяет включать в текст программы указанный файл. Если заголовочный файл содержит описание библиотечных функций и находится в папке компилятора, он заключается в угловые скобки <>.
Если файл находится в текущем каталоге проекта, он указывается в кавычках «». Для файла, находящегося в другом каталоге необходимо в кавычках указать полный путь.

#include <stdio.h>
#include «func.c»

Директива #define позволяет вводить в текст программы константы и макроопределения.
Общая форма записи

#define Идентификатор Замена

Поля Идентификатор и Замена разделяются одним или несколькими пробелами.
Директива #define указывает компилятору, что нужно подставить строку, определенную аргументом Замена, вместо каждого аргумента Идентификатор в исходном файле. Идентификатор не заменяется, если он находится в комментарии, в строке или как часть более длинного идентификатора.

1
2
3
4
5
6
7
8

#include <stdio.h>
#define A 3
int main()
{
  printf(«%d + %d = %d», A, A, A+A); // 3 + 3 = 6
  getchar();
  return 0;
}

В зависимости от значения константы компилятор присваивает ей тот или иной тип. С помощью суффиксов можно переопределить тип константы:

  • U или u представляет целую константу в беззнаковой форме (unsigned);
  • F (или f) позволяет описать вещественную константу типа float;
  • L (или l) позволяет выделить целой константе 8 байт (long int);
  • L (или l) позволяет описать вещественную константу типа long double

#define A 280U   // unsigned int
#define B 280LU  // unsigned long int
#define C 280    // int (long int)
#define D 280L   // long int
#define K 28.0   // double
#define L 28.0F  // float
#define M 28.0L  // long double

Вторая форма синтаксиса определяет макрос, подобный функции, с параметрами. Эта форма допускает использование необязательного списка параметров, которые должны находиться в скобках. После определения макроса каждое последующее вхождение

идентификатор(аргумент1, …, агрументn)

замещается версией аргумента замена, в которой вместо формальных аргументов подставлены фактические аргументы.

Пример на Си: Вычисление синуса угла

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.14159265
#define SIN(x) sin(PI*x/180)
int main()
{
  int c;
  system(«chcp 1251»);
  system(«cls»);
  printf(«Введите угол в градусах: «);
  scanf(«%d», &c);
  printf(«sin(%d)=%lf», c, SIN(c));
  getchar(); getchar();
  return 0;
}

Результат выполнения
Директива define

Отличием таких макроопределений от функций в языке Си является то, что на этапе компиляции каждое вхождение идентификатора замещается соответствующим кодом. Таким образом, программа может иметь несколько копий одного и того же кода, соответствующего идентификатору. В случае работы с функциями программа будет содержать 1 экземпляр кода, реализующий указанную функцию, и каждый раз при обращении к функции ей будет передано управление.
Отменить макроопределение можно с помощью директивы #undef.

Однако при использовании таких макроопределений следует соблюдать осторожность, например

1
2
3
4
5
6
7
8
9
10
11
12
13

#include <stdio.h>
#define sum(A,B) A+B
int main()
{
  int a, b, c, d;
  a = 3; b = 5;
  c = (a + b) * 2; // c = (a + b)*2
  d = sum(a, b) * 2; // d = a + b*2;
  printf(» a = %dn b = %dn», a, b);
  printf(» c = %d n d = %d n», c, d);
  getchar();
  return 0;
}

Результат выполнения:
Использование макроопределений define
По умолчанию текст макроопределения должен размещаться на одной строке. Если требуется перенести текст макроопределения на новую строку, то в конце текущей строки ставится символ «обратный слеш» — .

1
2
3
4
5
6
7
8
9
10
11
12
13
14

#include <stdio.h>
#define sum(A,B) A + 
                 B
int main()
{
  int a, b, c, d;
  a = 3; b = 5;
  c = (a + b) * 2; // c = (a + b)*2
  d = sum(a, b) * 2; // d = a + b*2;
  printf(» a = %dn b = %dn», a, b);
  printf(» c = %d n d = %d n», c, d);
  getchar();
  return 0;
}

Кроме того, директива #define позволяет замещать часть идентификатора. Для указания замещаемой части используется ##.

1
2
3
4
5
6
7
8
9

#include <stdio.h>
#define SUM(x,y) (a##x + a##y)
int main()
{
  int a1 = 5, a2 = 3;
  printf(«%d», SUM(1, 2)); // (a1 + a2)
  getchar();
  return 0;
}

Результат выполнения:
Использование ## в директиве #define

Условная компиляция

Директивы #if или #ifdef/#ifndef вместе с директивами #elif, #else и #endif управляют компиляцией частей исходного файла.
Если указанное выражение после #if имеет ненулевое значение, в записи преобразования сохраняется группа строк, следующая сразу за директивой #if. Синтаксис условной директивы следующий:

1
2
3
4
5
6
7

#if константное выражение
   группа операций
#elif константное выражение
   группа операций
#else
   группа операций
#endif

Отличие директив  #ifdef/#ifndef заключается в том, что константное выражение может быть задано только с помощью #define.

У каждой директивы #if в исходном файле должна быть соответствующая закрывающая директива #endif. Между директивами #if и #endif может располагаться любое количество директив #elif, однако допускается не более одной директивы #else. Директива #else, если присутствует, должна быть последней перед директивой #endif.

Пример

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

#include <stdio.h>
#include <stdlib.h>
#define P 2
int main()
{
  system(«chcp 1251»);
  system(«cls»);
#if P==1
  printf(«Выполняется ветка 1»);
#elif P==2
  printf(«Выполняется ветка 2, P=%d», P);
#else
  printf(«Выполняется другая ветка, P=%d», P);
#endif
  getchar();
  return 0;
}

Результат выполнения
Условная компиляция

Назад: Язык Си

Includes other source file into current source file at the line immediately after the directive.

[edit] Syntax

#include < h-char-sequence > new-line (1)
#include " q-char-sequence " new-line (2)
#include pp-tokens new-line (3)
__has_include ( " q-char-sequence " )
__has_include ( < h-char-sequence > )
(4) (since C++17)
__has_include ( string-literal )
__has_include ( < h-pp-tokens > )
(5) (since C++17)

1) Searches for a header identified uniquely by h-char-sequence and replaces the directive by the entire contents of the header.

2) Searches for a source file identified by q-char-sequence and replaces the directive by the entire contents of the source file. It may fallback to (1) and treat q-char-sequence as a header identifier.

3) If neither (1) nor (2) is matched, pp-tokens will undergo macro replacement. The directive after replacement will be tried to match with (1) or (2) again.

4) Checks whether a header or source file is available for inclusion.

5) If (4) is not matched, h-pp-tokens will undergo macro replacement. The directive after replacement will be tried to match with (4) again.

new-line The new-line character
h-char-sequence A sequence of one or more h-chars, where the appearance of any of the following is conditionally-supported with implementation-defined semantics:

  • the character
  • the character «
  • the character
  • the character sequence //
  • the character sequence /*
h-char Any member of the source character set (until C++23)translation character set (since C++23) except new-line and >
q-char-sequence A sequence of one or more q-chars, where the appearance of any of the following is conditionally-supported with implementation-defined semantics:

  • the character
  • the character
  • the character sequence //
  • the character sequence /*
q-char Any member of the source character set (until C++23)translation character set (since C++23) except new-line and «
pp-tokens A sequence of one or more preprocessing tokens
string-literal A string literal
h-pp-tokens A sequence of one or more preprocessing tokens except >

[edit] Explanation

1) Searches a sequence of implementation-defined places for a header identified uniquely by h-char-sequence, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.

2) Causes the replacement of that directive by the entire contents of the source file identified by q-char-sequence. The named source file is searched for in an implementation-defined
manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it reads syntax (1) with the identical contained sequence (including > characters, if any) from the original directive.

3) The preprocessing tokens after include in the directive are processed just as in normal text (i.e., each identifier currently defined as a macro name is replaced by its replacement list of preprocessing tokens). If the directive resulting after all replacements does not match one of the two previous forms, the behavior is undefined. The method by which a sequence of preprocessing tokens between a < and a > preprocessing token pair or a pair of » characters is combined into
a single header name preprocessing token is implementation-defined.

4) The header or source file identified by h-char-sequence or q-char-sequence is searched for as if that preprocessing token sequence were the pp-tokens in syntax (3), except that no further macro expansion is performed. If such a directive would not satisfy the
syntactic requirements of an #include directive, the program is ill-formed. The __has_include expression evaluates to 1 if the search for the source file succeeds, and to 0 if the search fails.

5) This form is considered only if syntax (4) does not match, in which case the preprocessing tokens are processed just as in normal text.

If the header identified by the header-name (i.e., < h-char-sequence > or " q-char-sequence ") denotes an importable header, it is implementation-defined whether the #include preprocessing directive is instead replaced by an import directive of the form

import header-name ; new-line

(since C++20)

__has_include can be expanded in the expression of
#if and
#elif. It is treated as a defined macro by
#ifdef,
#ifndef,
#elifdef,
#elifndef
(since C++23)
and defined but cannot be used anywhere else.

[edit] Notes

Typical implementations search only standard include directories for syntax (1). The standard C++ library and the standard C library are implicitly included in these standard include directories. The standard include directories usually can be controlled by the user through compiler options.

The intent of syntax (2) is to search for the files that are not controlled by the implementation. Typical implementations first search the directory where the current file resides then falls back to (1).

When a file is included, it is processed by translation phases 1-4, which may include, recursively, expansion of the nested #include directives, up to an implementation-defined nesting limit. To avoid repeated inclusion of the same file and endless recursion when a file includes itself, perhaps transitively, header guards are commonly used: the entire header is wrapped in

#ifndef FOO_H_INCLUDED /* any name uniquely mapped to file name */
#define FOO_H_INCLUDED
// contents of the file are here
#endif

Many compilers also implement the non-standard pragma #pragma once with similar effects: it disables processing of a file if the same file (where file identity is determined in OS-specific way) has already been included.

A sequence of characters that resembles an escape sequence in q-char-sequence or h-char-sequence might result in an error, be interpreted as the character corresponding to the escape sequence, or have a completely different meaning, depending on the implementation.

A __has_include result of 1 only means that a header or source file with the specified name exists. It does not mean that the header or source file, when included, would not cause an error or would contain anything useful. For example, on a C++ implementation that supports both C++14 and C++17 modes (and provides __has_include in its C++14 mode as a conforming extension), __has_include(<optional>) may be 1 in C++14 mode, but actually #include <optional> may cause an error.

[edit] Example

#if __has_include(<optional>)
#  include <optional>
#  define has_optional 1
   template<class T> using optional_t = std::optional<T>;
#elif __has_include(<experimental/optional>)
#  include <experimental/optional>
#  define has_optional -1
   template<class T> using optional_t = std::experimental::optional<T>;
#else
#  define has_optional 0
#  include <utility>
 
template<class V>
class optional_t
{
    V v_{}; bool has_{false};
public:
    optional_t() = default;
    optional_t(V&& v) : v_(v), has_{true} {}
    V value_or(V&& alt) const& { return has_ ? v_ : alt; }
    /*...*/
};
#endif
 
#include <iostream>
 
int main()
{
    if (has_optional > 0)
        std::cout << "<optional> is presentn";
    else if (has_optional < 0)
        std::cout << "<experimental/optional> is presentn";
    else
        std::cout << "<optional> is not presentn";
 
    optional_t<int> op;
    std::cout << "op = " << op.value_or(-1) << 'n';
    op = 42;
    std::cout << "op = " << op.value_or(-1) << 'n';
}

Output:

<optional> is present
op = -1
op = 42

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
CWG 787 C++98 the behavior is undefined if an escape sequence is
resembled in q-char-sequence or h-char-sequence
it is conditionally-supported

[edit] See also

The # include statement «grabs the attention» of the pre-processor (the process that occurs before your program is actually compiled) and «tells» the pre-processor to include whatever follows the # include statement.

While the pre-processor can be told to do quite a bit, in this instance it’s being asked to recognize a header file (which is denoted with a .h following the name of that header, indicating that it’s a header).

Now, a header is a file containing C declarations and definitions of functions not explicitly defined in your code. What does this mean? Well, if you want to use a function or define a special type of variable, and you know that these functions/definition are defined elsewhere (say, the standard library), you can just include (# include) the header that you know contains what you need. Otherwise, every time you wanted to use a print function (like in your case), you’d have to recreate the print function.

If its not explicitly defined in your code and you don’t #include the header file with the function you’re using, your compiler will complain saying something like: «Hey! I don’t see where this function is defined, so I don’t know what to with this undefined function in your code!».

#include is a way of including a standard or user-defined file in the program and is mostly written at the beginning of any C/C++ program. The #include preprocessor directive is read by the preprocessor and instructs it to insert the contents of a user-defined or system header file in our C/C++ program. These files are mainly imported from outside header files.

The process of importing such files that might be system-defined or user-defined is known as File Inclusion. This preprocessor directive tells the compiler to include a file in the source code program.

Types of Header Files

There are two types of files that can be included using #include:

1. Pre-Existing Header Files: The pre-existing header files come bundled with the compiler and reside in the standard system file directory. This file contains C/C++ standard library function declarations and macro definitions to be shared between several source files. Functions like the printf(), scanf(), cout, cin, and various other input-output or other standard functions are contained within different Pre-Existing header files.

2. User-Defined Header Files: These files resemble the header files, except for the fact that they are written and defined by the user itself. This saves the user from writing a particular function multiple times.

Syntax of #include

There are two variations of how we can use #include in our C/C++ program.

1. Including using <>

It is mainly used to access pre-existing system header files located in the standard system directories.

#include <header_file>

While importing a file using angular brackets(<>), the preprocessor uses a predetermined directory path to access the file.

2. Including using ” “

This type is mainly used to access any header files of the user’s program or user-defined files.

#include "user-defined_file"

When using the double quotes(” “), the preprocessor accesses the current directory in which the source “header_file” is located or the standard system directories.

To import the user-defined header file using #include, the file should be in a directory path relative to your C source file otherwise, the preprocessor will begin search for it in the standard system directory.

Examples of #include

Example 1

The below code shows the import of a system I/O header or standard file.

C

#include <stdio.h>

int main()

{

    printf("hello world");

    return 0;

}

C++

#include <iostream>

using namespace std;

int main()

{

    cout << "hello world";

    return 0;

}

Example 2

The below code shows the creation and import of a user-defined file.

Creating a user-defined header by the name of “process.h”.

C

void add(int a, int b)

{

    printf("Added value=%dn", a + b);

}

void multiply(int a, int b)

{

    printf("Multiplied value=%dn", a * b);

}

Created the main file where the above “process.h” will be included. 
 

C

#include <stdio.h>

#include "process.h"

int main()

{

    add(10, 20);

    multiply(10, 20);

    printf("Process completed");

    return 0;

}

Explanation

Including the “process.h” file into another program. Now as we need to include stdio.h as #include in order to use printf() function similarly, we also need to include the header file process.h as #include “process.h”. The ” ” instructs the preprocessor to look into the present folder or the standard folder of all header files, if not found in the present folder.

If angular brackets are used instead of ” ” the compiler will search for the header file in the standard folder of header files. If you are using ” ” you need to ensure that the created header file is saved in the same folder in which the current C file using this header file is saved.

Last Updated :
23 Jun, 2023

Like Article

Save Article

Понравилась статья? Поделить с друзьями:
  • Инструкция imax b6 видео инструкция на русском
  • Инструкция icsee настройка камеры на русском
  • Инструкция iconbit toucan duo plus mk2
  • Инструкция ice cream machine на русском языке
  • Инструкция ibox one laservision wifi signature