What does the #include directive do?

QuestionsQuestions8 SkillsProCreate "Hello World" In CAug, 24 2025
0185

The #include directive is used in C++ to include the contents of a specified file or library into the program. This allows you to use functions, classes, and other definitions that are declared in that file.

For example, #include <iostream> includes the standard input-output stream library, which provides functionalities for input and output operations, such as std::cout for printing to the console and std::cin for reading input from the user.

You can include standard libraries using angle brackets (< >) or your own header files using double quotes (" ").

0 Comments

no data
Be the first to share your comment!