为VS添加bits/stdc++.h头文件

为VS添加bits/stdc++.h头文件

这两天才发现#include的神奇之处,一个它几乎包含了所有的头文件啊,省了好多事!但有利就有弊,他比较消耗时间,但和总体相比,还是值得的。
这里面一般路径不太好找,我的如下
为VS添加bits/stdc++.h头文件_第1张图片
你们可以参考一下。
接下来,添加步骤

  1. 【如果安装了MinGW的直接在文件夹里面找到bits这个文件夹,把里面内容复制粘贴到vs的头文件库里面】

  2. 如果没有安装MinGW,那就跟着我来做以下步骤:

    1. 新建txt文档,把以下代码(stdc++.h源码)复制进去:
 // C++ includes used for precompiling -*- C++ -*-
 
// Copyright (C) 2003-2015 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
  1. 把txt文档改名stdc++.h
    在这里插入图片描述
  2. 打开我上面给的目录(一般在C盘里面,而且不太好找)
  3. 然后依次打开文件夹“14.15.26726”“include”
    在“include”目录下新建文件夹“bits”,然后把刚才的bits/stdc++.h移入。
    在这里插入图片描述
    为VS添加bits/stdc++.h头文件_第2张图片
    关闭vs再次打开就发现已经存在了。

你可能感兴趣的:(C++之ACM,C++)