C++ Basics: Prepared By: Ms. Marichu A. Bautista
C++ Basics: Prepared By: Ms. Marichu A. Bautista
#include is a preprocessor
instruction <iostream> -
brackets tell the
preprocessor to look in all
the places for this file
iostream
(input-output-stream)
LINE 1
#include <iostream>
Effect:
To include the file
iostream into the
program
LINE 2
using namespace std;
- We are telling the
compiler to use a
group of functions
included in the
standard library std;
- The function that we
are using is the cout
function in line 6.
LINE 4
int main ( );
- main ( ) must state what
kind of value it will return.
- the return value type for
main is void, which means
that this function will not
return any value at all.
- If a program is executed
without this function, it
will not run at all.
LINE 5
{ } opening and closing
braces
- everything between the
opening and closing
braces is considered a part
of the function.
LINE 6
cout<<
- the object cout is used to
print a message to the
screen.
- cout (console output)
- << output redirection
operator
(whatever follows the output
redirection operator is
written to the screen)
LINE 8
return 0;
- shows whether or not the
function successfully
executed.
cin>> (input redirection operator)