Professional Documents
Culture Documents
Oriented Programming
Lecture 2: Some C++
Fundamentals
Topics to be Covered
A Sample C++ Program
Namespaces
A Closer Look at the I/O Operators
Declaring Local Variables
No Default to int
The bool Data Type
Old-Style vs. Modern C++
The New C++ Headers
C++ Console I/O (Input)
C++ Console I/O (Output)
Mohammad Nazmul Haque Lecturer, Dept. of CSE, DIU 2
A Sample C++ Program
Modern Style of C++ I/O Operation Header
#include <iostream>
using namespace std;
Specify standard library of global namespace std
int main()
{
cout << output operator
int i;
return 0;
}
common practice to not specify int In Standard C++, this function must
explicitly when a function returned have the return type of int Specified.
an integer result.