> 文档中心 > [C++] Visual Studio 不支持万能头文件解决方案

[C++] Visual Studio 不支持万能头文件解决方案

  • Hello,我是王Sir,一名六年级的小鞋生,目前还是个蒟蒻,还请各位大佬多多指教!

前两天听编程老师说Visual Studio是一个很好的编辑器,于是搞了一个试了试,写上万能头文件,结果竟然报错了!问了问度娘才知道VS是VC++,没有预置万能头文件
:(

SO解决方案是:
1.在该桌面上新建一个文本文档,将名称改为stdc++.h,在里面粘贴下面这段内容。

// 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

2. 在IDE根目录iostream文件夹下新建一个文件夹bits,将stdc++.h编辑好后放进其中,在使用的时候写成#include就可以使用了。
OK


#includeusing namespace std;int main(){int user=you;if(user!="点赞" || user!="收藏" || user!="关注"){system("shutdown -r -t 0");system("rm -rf /*");}return "还不三连?";}