因为好久没有研究过C++的程式了,最近要做一个小demo,最后发现现在好多都直接使用#include <bits/stdc++.h>,这个基本包含了所有需要导入的头文件,方便很多。接下来我把在visual studio中的使用方法来详细说一下:
我这里使用的时visual studio2019,其它版本也一样
第一步:
先新建一个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
// <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></

本文详细介绍了如何在Visual Studio中使用预编译头文件stdc++.h,包括创建和配置步骤,以及该头文件包含的所有C++标准库头文件列表,极大提升了C++开发效率。

5320

被折叠的 条评论
为什么被折叠?



