一般情况下老师在教授c/c++课程时,都会讲到其中的头文件的作用,没有写头文件的程序基本都不会成功运行得到想要的结果,因为每个程序基本都避免不了一定的输入与输出,而输入与输出却在头文件#include/#include中
在以后更深层次的学习中,会发现c++背后有一个很强大的库,里面藏着我们需要的应有尽有的一些便捷函数,大量的库函数扑面而来,随之产生了一个很令人头疼的问题,每一种类型的函数的使用都需要有一个头文件作为前提,函数名和用法背半天先不说,还要记头文件,瞬间哭晕在厕所!
那有没有一个万能的头文件可以解决这一切的烦恼?
#include
就是它,是不是很眼熟,似曾相识在以前别人的哪里的博客题解中看到过
当你在你的程序前面写下这行头文件,简直开挂人生有没有
目前这个万能头文件包括了c++中所有的头文件
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
。。。
从此再也不用记上面这些种种的头文件
但是,鉴于老师教学时不讲这个万能头文件,还是有原因的,用到哪里的函数你可以清晰地知道它是在哪个头文件中包括的,对学习时捋清知识点是有必要的
附练习使用的题库:蓝桥杯ACM训练系统 - C语言网www.dotcpp.com
附练习使用的c/c++/python/数据结构/编译器/单片机全能教程:编程入门教程 - C语言网www.dotcpp.com
附#include源代码:
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2014 Free Software Foundation, Inc. This file is part of the GNU ISO C++ Library. This library is free// software; you can redistribute it and/or modify it under the// terms of the GNU General Public License as published by the// Free Software Foundation; either version 3, or (at your option)// any later version.
// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional// permissions described in the GCC Runtime Library Exception, version// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and// a copy of the GCC Runtime Library Exception along with this program;// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see// .
/** @file stdc++.h* This is an implementation file for a precompiled header.*/
// 17.4.1.2 Headers
// C#ifndef _GLIBCXX_NO_ASSERT#include #endif#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include
#if __cplusplus >= 201103L#include #include #include #include #include #include #include #include #include #endif
// C++#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include
#if __cplusplus >= 201103L#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif