From 《C++ Library reference 概览》, include come from ‘algorithm -> merge -> includes’.
From geeksforgeeks, #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. This directive is read by the preprocessor and orders it to insert the content of a use-defined or system header file into the following program.
There are two types of file that can be included using #include:
- Header File or Standard files
- User-define files
And there are two syntax using the #include command:
-
#include "user-defined-file"When using the double quotes(" "), the preprocessor access the current directory in which the source “user-defined-file” is located.
This type is mainly used to access any header files of the user’s program or user-defined files.
-
#include <header_file>While importing file using angular bracket(<>), the preprocessor uses a predetermined directory path to access the file. It is mainly used to access system header files located in the standard system directories.
本文详细解析了C++编程语言中#include指令的使用方法,包括其两种主要类型:标准文件包含与用户定义文件包含。文章阐述了双引号与尖括号在预处理器中的不同作用,以及它们如何帮助程序员在程序开始时引入必要的文件。
4478

被折叠的 条评论
为什么被折叠?



