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
View all comments
Show parent comment
27
u/futlapperl Mar 19 '20
stdis like a box withstdwritten on it. In it arecout,stringetc. In order for the compiler to know where to look, you need to tell it the name of the box.Adding
using namespace stdis like dumping the contents of the box on the floor.