本文主要是介绍理解C++中#include <iostream>,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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 <iostream>的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!