C++ Basic Input/Output
In this post, we will discuss C++ Basic input /output statements. The iostream library provides the objects for doing input and output. cout is the output stream object for output and the << operator. cin is the input stream object for doing the input and the operator >>
In order to use the objects we need to include
If you omit the include statement, you will get errors.
‘cout’ was not declared in this scope
‘cin’ was not declared in this scope
cin has some helpful functions to prevent the input from the user. For example, cin.fail() The fail function will return true if there are errors in the input stream.
// proceed with the code
The example C++ program with both input and output statements :
C++ Tutorials on this website:
For more information on the current ISO C++ standard