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

  • C# Programming
    C# (pronounced “C sharp”) a programming language developed by Anders Hejlsberg (the ...
  • Data Types
    Generally data types refer to the classification of various types of data that a computer ...
  • Software
  • Function
    In programming, a function is a procedure that performs a specific&nbsp;task. It is ...
  • ASP (Active Server Pages)
    ASP (Active Server Pages) on Windows web servers, a system for generating web pages partly ...