DEV Community

Cover image for Include
Saloni Goyal
Saloni Goyal

Posted on • Edited on

1 1

Include

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!

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay