Introduction To C++
in this page we will learn about c++ programming Language :
What is C++
- C++ pronounced as ("See Plus Plus") is a programming language began as an expended version of C language.
- The C++ were first invented by Bajarny stroustruop in 1979 at Bell Laboratories in Murray Hill, New jersey.
- C++ is middle level programming language.
- C++ is a statically typed, compiled, general purpose, case -sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.
2 Programming pattern
C++ fully supports object-oriented programming, including the four pillars of object-oriented development: Encapsulation, Data hiding, Inheritance, Isomorphism.Generic programming or Polymorphism is a programming style that allow one value to take on different types as long as certain contracts such as subtypes signature are kept.
3.C++ Basic Syntax
Let us look at a simple code that would print the words Hello World.
#include<iostream>
using namespace std;
int main()
{
cout <<"Welcome to C++";// prints Welcome TO C++
return 0;
}
Let us look various parts of the above program:
The C++ language defines several headers, which contain information that is either necessary or useful to your program. For this program, the header <iostream> is needed.
The line using namespace std; tells the compiler to use the std namespace.
The line int main() is the main function where program execution begins.
The next line cout << "Hello World."; causes the message "Welcome To C++" to be displayed on the screen.
The next line return 0; terminates main() function and causes it to return the value 0 to the calling process.
The C++ language defines several headers, which contain information that is either necessary or useful to your program. For this program, the header <iostream> is needed.
The line using namespace std; tells the compiler to use the std namespace.
The line int main() is the main function where program execution begins.
The next line cout << "Hello World."; causes the message "Welcome To C++" to be displayed on the screen.
The next line return 0; terminates main() function and causes it to return the value 0 to the calling process.
No comments:
Post a Comment