Why so many students are using '#include<bits/stdc++.h>' instead of '#include<iostream>'?
I am hiring for my company. And the codes submitted for a test problem has '#include<bits/stdc++.h>' at the beginning. The MacOS default compiler complains
main.cpp:1:9: fatal error: 'bits/stdc++.h' file not found
#include<bits/stdc++.h>
^~~~~~~~~~~~~~~
1 error generated.
Why people are using '#include<bits/stdc++.h>'?
225
Upvotes
12
u/vibeTechr Mar 19 '20
bits/stdc++.h is a big header file that includes a lot of other headers, as the name suggests, from the standard library. GCC comes with that file, but MacOS has CLang as default compiler, and CLang doesn't have it (I don't know if you can add it or something) so it complains. Most of the time you can just switch it with iostream, but you might need also to include vectors or lists or other components of the standard library, depending on the project.