Search code examples
c++include

Shortcut of Importing/Including All Library in C++


In java we can import all class from a package using '*' like - java.lang.*.

While coding in C++ we imports multiple library like this -

#include<cstdio>
#include<iostream>
.....

Is there any shortcut/way in C++ to include all these library using a single statement/line?
Thanks


Solution

  • There's nothing available for c++ like in your java sample.

    Roll your own header to include all stuff you need.

    E.g.

    AllProjectHeaders.h


    #ifndef ALLPROJECT_HEADERS
    #define ALLPROJECT_HEADERS
    
    #include<cstdio>
    #include<iostream>
    // ...
    
    #endif