VS添加万能头文件(超详细)

<bits/stdc++.h>这个头文件被大家亲切地成为万能头文件,在敲代码的时候往往可以给我们省去很多时间,但是这个头文件在VS中并没有,喜欢用VS的人经常为此感到烦恼,我就在为添加这个万能头文件上花了许多功夫,也查看了很多资料,那今天就为大家总结并讲解一下头文件添加的具体方式。

一 第一步就是我们要找到 include 这个文件夹的所在路径,由于大家在下载安装VS时对路径的选择不一样,这里给到一个小 tip(如果可以找到就可以直接跳过) :

1.首先我们打开一个项目,找到资源管理器,并找到如下图右边所示的 解决方案~ 然后右键

右键进入 属性 页面

2.最后在 调试源文件 下可以看到具体路径。

 二 按照路径我们进入 include 文件夹 并在里面新建文件夹 bits

 进入后再添加头文件 stdc++.h (可以在桌面创建 文本文档 并把头文件的内容复制进去,再改一下文件名,头文件的内容我会放在最后)

三 按照上面的步骤操作后,重启VS进入项目,或许有些人(我就是其一)会发现VS依然显示无法打开<bits/stdc++.h>这个头文件,在经过一番查阅之后,问题出现在对 stdc++.h重命名这步上。在win10里,文件名的后缀默认是隐藏的,所以下面给出具体解决方案(要是一切运行正常的同学就可以跳过这一步了)

1.首先按照之前找到的路径进入 include 将光标移动到我们新建的文件夹 bits 上并单击,上方会出现窗口,然后我们继续点击 查看,进入一下页面

 然后勾选 文件拓展名 就可以了,再进入 bits 就可以看到文件的后缀,在重新进行修改为 stdc++.h就可以了,之后重启VS就大功告成了

/下面是给大家找到的头文件的内容///

// 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// <http://www.gnu.org/licenses/>.
/** @file stdc++.h *  This is an implementation file for a precompiled header. */
// 17.4.1.2 Headers
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

  • 50
    点赞
  • 131
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值