C++ Programming Language

C++ an Object-Oriented Programming language developed by Bjarne Stroustrup at Bell Laboratories in the mid-1980s as a successor to C. In C and C++, the expression C++ means “add 1 to C.

Comments are introduced by // and object types are declared as class. The part of an object that is accessible to the outside world is declared as public.

C++ lets the programmer overload operators (give additional meanings to them). For example, + normally stands for integer and floating point addition. In C++, you can define it to do other things to other kinds of data, such as summing matrices or concatenating strings.

C++ is the basis of the Java and C# programming languages.

A C++ program looks like:

// Sample C++ program —M. Covington 1991
// Uses Turbo C++ graphics procedures

#include <graphics.h>
class pnttype {
		int x, y;
		void draw() { putpixel(x,y,WHITE); }
class cirtype: public pnttype {
		int radius;
		void draw() { circle(x,y,radius); }

	int driver, mode;
	driver = VGA;
	mode = VGAHI;
	pnttype a,b;
	cirtype c;
	a.x = 100;
	a.y = 150;
	c.x = 200;
	c.y = 250;
	c.radius = 40;


In C++, input-output devices are known as streams. The statement

cout << ”The answer is ” << i;

sends “The answer is” and the value of i to the standard output stream. This provides a convenient way to print any kind of data for which a print method is defined.


Share it:  Cite

More from this Section

  • ASP (Active Server Pages)
    ASP (Active Server Pages) on Windows web servers, a system for generating web pages partly ...
  • Object-Oriented Programming
    Object-oriented programming (OOP) is defined as a concept of programming based on objects&nbsp;in ...
  • Computer-Aided Engineering (CAE)
    Computer-Aided Engineering (CAE) refers the use of computers to guide or control the actual ...
  • Inheritance
    Inheritance&nbsp;is the most important feature of Object-Oriented Programming. Inheritance ...
  • Function
    In programming, a function is a procedure that performs a specific&nbsp;task. It is ...