What is meant by the statement #include?

#include<iostream>: This is a directive which causes the preprocessor to add the contents of iostream, which is a header file and must be added above all of a program where input/output statements has been used. We will include the header file with the statement

                                                          #include <iostream>

The iostream package automatically defines a variable (an object) called cout that accepts all data bound for standard output. To send data to standard output, we use the operator <<. In C it was “bitwise left shift,”. But C++ allows operators to be overloaded and here in iostream , the operator << means “send to” For example:

                                                            cout << "TANMAY";

sends the string “TANMAY” to the object called cout, which is short for “console output”. Then using the cout object of the header file iostream the text is displayed on the screen.

Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends


Contact Us