CS118 –
Programming
Fundamentals
Lecture # 04
Spring 2022
Ms. Aysha
Ashraf
, Basics of a Typical C++
9 Program
Environment … object
Standard output stream
std::cout
“Connected” to screen
<<
Stream insertion operator
Value to right (right operand) inserted into output stream
Namespace
std:: specifies that entity belongs to “namespace”
using binary scope resolution operator(::)
std:: removed through use of using statements
Escape characters: \
Indicates “special” character output
CS 118 - FALL
2020
, Hello
1
0
World++
/ / Hell o Worl d comment
p rogram
#include <iostream> Allows access to an I/O
library
i n t main ( ) { Starts definition of special
function main()
s t d : : c o u t << " H e l l o World\ n" ;
output (print) a
string
r e t urn 0 ;
} Program returns a status
code (0 means OK)
CS 118 - FALL
2020
Programming
Fundamentals
Lecture # 04
Spring 2022
Ms. Aysha
Ashraf
, Basics of a Typical C++
9 Program
Environment … object
Standard output stream
std::cout
“Connected” to screen
<<
Stream insertion operator
Value to right (right operand) inserted into output stream
Namespace
std:: specifies that entity belongs to “namespace”
using binary scope resolution operator(::)
std:: removed through use of using statements
Escape characters: \
Indicates “special” character output
CS 118 - FALL
2020
, Hello
1
0
World++
/ / Hell o Worl d comment
p rogram
#include <iostream> Allows access to an I/O
library
i n t main ( ) { Starts definition of special
function main()
s t d : : c o u t << " H e l l o World\ n" ;
output (print) a
string
r e t urn 0 ;
} Program returns a status
code (0 means OK)
CS 118 - FALL
2020