最近我看到#include <bits/stdc++.h>
可以引用所有的标准库和stl头文件。但是当我在visual studio 2013编译以下代码段时,它会报错:error C1083: Cannot open include file: 'bits/stdc++.h': No such file or directory
。但是在codeblocks中它却可以完美地工作。有没有什么方法可以避免这个错误?
#include <bits/stdc++.h>
using namespace std;
int main()
{
}
我在一些帖子中看到过“头文件不是C++标准的一部分,因此不可移植”,应该避免使用。但我认为在竞赛编程中很有帮助。