Posts

Showing posts from February, 2021

C++ Inheritance

 Inheritance Inheritance is the mechanism in which new class adopt the properties of the old class. It is the capability of a class to derive properties and characteristics from another class. Inheritance is one of the most important feature of object oriented programming. The derive class inherited the features of the base class and can have additional features of its own.  Inheritance is an "is a" relationship. We use Inheritance only if an is a relationship is present between two classes. Here, are some examples- A car is a vehicle. Car----derive class Vehicle----base class The main advantages of inheritances are code reusability and readability when child class inherit the properties of functionality of parent class, we need not to write the properties of functionality of parent class, we need not to write the same code again in child class.

C++ class

  C++ Class Definitions A class has a class name, a set of attributes (data members and characteristics) and a set of actions or services. Class is an explicit datatype. The class specified the type and scope of variables and functions declared inside the class. The variables declared inside the class are known inside the class are known as data member or menber variables and the functions are called member functions. The body of the class is enclosed within braces and terminated by the semicolon. The keyboards private, public and protected are known as visibility levels, which defines the visibility of member.    A C++ class is like a blueprint for an object. A Class is a user defined data-type which has data members and member functions. Data members are the data variables and member functions are the functions used to manipulate these variables and together these data members and member functions defines the properties and behavior of the objects in a Class. In the above example of

History of C++

Image
HISTORY History of  C++ language is interesting to know. Here we are going to discuss brief history of C++ language. C++ programming language  was developed in 1980 by Bjarne Stroustrup at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A. Bjarne Stroustrup  is known as the  founder of C++ language.                   SOME FACTS ABOUT C++ 1.C++ development began in 1979, four years before its release, and it did not start with the name C++; Its first name was  C with classes . 2.In the late part of 1983, C with Classes was first used for AT&T's internal programming needs. 3.Its name was changed to C++ later in the same year. 4.C++ was not released commercially until the late part of 1985. C++ implements  data abstraction  using a concept called  classes , along with other features to allow  object-oriented programming  and is considered a  high-level language . Classes help programmers with the organization of their code. They can also be benef