DEV Community

loading...
Cover image for Include

Include

blender profile image Saloni Goyal Updated on ・1 min read

In order to use stream I/O, we have to include iostream.

#include <iostream>

The #include directive allows us to -

  • include a file into our application
  • opens up a world of libraries and capabilities

Alt Text

To access anything in the C++ STL, that is all you have to do, just include it. For some other libraries, they might need to be linked as well.

Based on the library, it can be accessed as a -
i) Header only library: like STL, simply write #include to use it
ii) Linked library: needs to be linked with your object files by the linker

Using code that is already written saves us time and testing effort and it allows us to build our application on top of it.

Please leave out comments with anything you don't understand or would like for me to improve upon.

Thanks for reading!

Discussion (0)

pic
Editor guide