The C++ Language
Mrs. K. NITHYANANDAKUMARI
Assistant Professor of Computer Science
C.P.A. College
Bodinayakanur
Overview of ‘C++’�
Outline
C++ Features�
Compiling and Linking�
A Simple C++ Program
#include <cstdlib>
#include <iostream>
using namespace std;
int main ( ) {
intx, y;
cout << “Please enter two numbers:”;
cin >> x >> y;
int sum = x + y;
cout << “Their sum is “ << sum << endl;
return EXIT_SUCCESS;
}
The #include Directive
#include <iostream>
#include <cstdlib>
incorporate the declarations of the iostream and cstdlib libraries into the source code.
The using Statement�
using namespace std;
tells the compiler to make all names in the predefined namespace std available.
using namespace std;
is an easy way to get access to the standard library.
using std::cin;
using std::cout;
using std::string;
using std::getline;
Compiling and Executing�
THANK YOU
www.myassignmenthelp.net