Introduction

1.6 - Include directives


This line is an include directive:

#include <iostream>

Include directives are usually placed at the start of the code.

The <iostream> header contains the definition for std::cout and std::endl. Before we can use them we need to include the <iostream> header.

Task

Include the <iostream> header.

  • Put #include <iostream> at the start of the code.
int main() { std::cout << "Never forget #include <iostream>" << std::endl; }