I am confused with the differences between iostream and bits/stdc++.h ? in competitive programming is it okay to use bits/stdc++.h or are there any consequences
-
1Does this answer your question? [Why should I not #include
?](https://stackoverflow.com/questions/31816095/why-should-i-not-include-bits-stdc-h) – Muhammad Arbaz Zafar Jun 07 '21 at 06:37
1 Answers
You can't really compare the two. iostream
is a header file that allows you to use input (cin
) and output (cout
). A header file is basically just a file with a collection of functions you can use to make coding easier. This is similar to the built in library in Python (Ex: import random
). bits/stdc++.h
is basically a way to import every single C++ header file. Many competitive programmers use this because they don't have to import every popular header file. However, a disadvantage is that it increases compilation time because it has to search through every possible functions. Most people do not find this to be too much of an issue, however, so you can probably go ahead and use it. However, it is considered bad practice to do this in actual software engineering. Hope this helps and have a good day :)

- 1
- 1