How does include bits stdc h work in C duplicate

0 votes
According to a codeforces blog, if we include #include bits/stdc++.h> in a C++ application, there is no need to include any additional header files.

Is it OK to use #include bits/stdc++.h> instead of include separate header files?
Jun 21 in C++ by Nicholas
• 2,520 points
17 views

1 answer to this question.

0 votes
#include <bits/stdc++.h> is a precompiled header implementation file.

Minimizing the inclusion is a smart approach from the standpoint of software engineering.

If you use bits/stdc++.h>, it includes a number of files that your programme may not need, increasing both compilation time and programme size needlessly.

However, in competitions, employing this file is a smart idea if you want to minimise the time spent on tasks, especially if your rank is time-sensitive.

It is compatible with the majority of online judges and programming contest venues, including ACM-ICPC (Sub-Regionals, Regionals, and World Finals) and many more online judges.

Its downsides are as follows:

1. lengthens the compiling time

2. Because it makes use of a non-standard internal header file of the GNU C++ library, it will not build with MSVC, XCode, or many other compilers.
answered Jun 21 by Damon
• 4,240 points

Related Questions In C++

0 votes
0 answers

How to traverse stack in C++?

Is traversing std::stack possible in C++? It is not possible to traverse using the following method.  Because there is no member end in std::stack. std::stack<int> foo; // .. for (__typeof(foo.begin()) it = foo.begin(); ...READ MORE

Jun 1 in C++ by Nicholas
• 2,520 points
26 views
0 votes
1 answer

How to use new[ ] and delete[ ] operator in C++

int main(){ char *str; ...READ MORE

answered Jun 20 in C++ by Damon
• 4,240 points
13 views
0 votes
1 answer

Use of "this" keyword in C++ [duplicate]

Yes, it is optional and generally omitted.  However, it may be essential for accessing variables after they have been overridden in the scope: Person::Person() { int age; ...READ MORE

answered Jun 20 in C++ by Damon
• 4,240 points
14 views
0 votes
1 answer

How to use enums in C++

This will be sufficient to declare your ...READ MORE

answered Jun 20 in C++ by Damon
• 4,240 points
8 views
0 votes
1 answer

Cant find library in /usr/bin/ld

Say your library "libxyz.so" is located in: /home/user/myDir then ...READ MORE

answered Mar 26, 2019 in Linux Administration by ajs3033
• 7,280 points
9,987 views
0 votes
1 answer

Convert char to int in C and C++

In order to read the value as ...READ MORE

answered Feb 17 in Others by Aditya
• 7,280 points
314 views
0 votes
0 answers

How to compile for Windows on Linux with gcc/g++?

I have written some effects in C++ ...READ MORE

Apr 13 in Linux Administration by Rahul
• 8,980 points
29 views
0 votes
1 answer

How to use std::sort to sort an array in C++

We receive std::begin and std::end in C++0x/11, which are overloaded for arrays: #include <algorithm> int main(){ int v[2000]; ...READ MORE

answered Jun 1 in C++ by Damon
• 4,240 points
15 views
0 votes
1 answer

Function default argument value depending on argument name in C++ [duplicate]

When the function is called with no argument for the corresponding parameter, the default argument is evaluated.  In a default argument, a parameter must not appear as a potentially evaluated expression.  A function's parameters declared before a default argument are in scope and can obscure the namespace and class member name. It provides the following example: int h(int a, ...READ MORE

answered Jun 7 in C++ by Damon
• 4,240 points
10 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP