0

" <bits/stdc++.h> is a header file in c++ which includes every necessary files in our programm. "

I found this from an article. But I'm confused when should we have to use this header file.

Case 1. If we want to write less lines of code.

Case 2. When have to do get fast compilation and execution of a large amount of input/output data.

Rajeev R S
  • 25
  • 3
  • 6
    *when should we have to use this header file* -- Never. In addition, using that non-standard header and `using namespace std;`, get ready for weird compiler errors if you have an identifier named [data](https://en.cppreference.com/w/cpp/iterator/data) in your program. – PaulMcKenzie Feb 16 '22 at 08:47
  • the article was lying to you. it is not a (standard) C++ header. Wanting to write less lines of code is ok, but it can turn into bad when it comes at the cost of clarity of the code. – 463035818_is_not_an_ai Feb 16 '22 at 08:57
  • 3
    _"Case 2. When have to do get fast compilation"_ - this header does exactly the opposite, it slows down compilation, because it puts every single header file of the standard library in the compilation unit. – Lukas-T Feb 16 '22 at 09:00

0 Answers0