非常教程

C参考手册

C 语法

#include directive

将另一个源文件包含在紧跟在该指令之后的行中的当前源文件中。

句法

#include <filename>

(1)

#include "filename"

(2)

说明

将源文件(由文件名标识)包含在紧跟在指令之后的行中的当前源文件中。

该指令的第一个版本仅搜索标准包含目录。标准 C ++库以及标准 C 库隐式包含在标准包含目录中。标准 include 目录可以由用户通过编译器选项来控制。

版本(2)首先搜索当前文件所在的目录,并且仅在未找到该文件时搜索标准包含目录。

在没有找到该文件的情况下,该程序不合格。

参考

  • C11标准(ISO / IEC 9899:2011):
    • 6.10.2源文件包含(p:164-166)
  • C99标准(ISO / IEC 9899:1999):
    • 6.10.2源文件包含(p:149-151)
  • C89 / C90标准(ISO / IEC 9899:1990):
    • 3.8.2源文件包含

C 语法相关

1.#define directive
2.#elif directive
3.#else directive
4.#endif directive
5.#error directive
6.#if directive
7.#ifdef directive
8.#ifndef directive
9.#line directive
10.#pragma directive
11.alignas
12.Alternative operators and tokens
13.Analyzability
14.Arithmetic operators
15.Arithmetic types
16.Array declaration
17.Array initialization
18.ASCII Chart
19.Assignment operators
20. types
21.Basic concepts
22.Bit fields
23.break statement
24.C language
25.C Operator Precedence
26.cast operator
27.character constant
28.Comments
29.Comparison operators
30.compound literals
31.Conditional inclusion
32.Conformance
33.const type qualifier
34.Constant expressions
35.continue statement
36.Declarations
37.do-while loop
38.Enumerations
39.Escape sequences
40.Expressions
41.External and tentative definitions
42.File scope
43.floating constant
44.for loop
45.Function declarations
46.Function definitions
47.Functions
48.Generic selection
49.goto statement
50.Identifier
51.if statement
52.Implicit conversions
53.Increment/decrement operators
54.Initialization
55.inline function specifier
56.integer constant
57.Lifetime
58.Logical operators
59.Lookup and name spaces
60.Main function
61.Member access operators
62.Memory model
63.Objects and alignment
64.Order of evaluation
65.Other operators
66.Phases of translation
67.Pointer declaration
68.Preprocessor
69.restrict type qualifier
70.return statement
71.Scalar initialization
72.Scope
73.sizeof operator
74.Statements
75.static assert declaration
76.Static storage duration
77.Storage-class specifiers
78.string literals
79.Struct and union initialization
80.Struct declaration
81.switch statement
82.Thread storage duration
83.Type
84.Type
85.Typedef declaration
86.Undefined behavior
87.Union declaration
88.Value categories
89.Variadic arguments
90.volatile type qualifier
91.while loop
92._Alignof operator
93._Noreturn function specifier
C

C 语言是一门通用计算机编程语言,应用广泛。C 语言的设计目标是提供一种能以简易的方式编译、处理低级存储器、产生少量的机器码以及不需要任何运行环境支持便能运行的编程语言。