How do I start learning C++ programming? | Definition, About, features of C++ programming and learn OOPs concept of C++ programming.
What is C++ Programming
C++ is an object-oriented programing language which gives a clear structure to programs and allows code to be reused, lowering development cost. It is class base programming language.
About C++ Language
- C++ is a cross-platform language that can be used to create high-performance applications.
- C++ was developed by Bjarne Stroustrup at Bell Labs in 1979.
- The different edition of C++ programming release in 1985, 1989, 1998, etc.
- C++ is standardized by the International Organization for Standardization.
Features of C Language
- Classes & Objects is the process of hiding irrelevant information from the user.
- Abstraction is the process of hiding background detail and showing essential information.
- Encapsulation is the process wrapping of data member and member function in to single class.
- Inheritance is the process of child class access all properties of their parent class and also access their own.
- Polymorphism is the process to create having many forms.
OOPs Concept of C++ Programming Language
OOPs stands for object oriented programming language.
As name suggest object means it is completely depend on class without class can't write program in C++ Language.
Abstraction, Encapsulation, Inheritance, Polymorphism these are the four pillars of Object Oriented Programming.
Object Oriented programming aims to implement real world entities like inheritance, hiding, polymorphism in programming.
OOPs is bind together the data and the functions that operate on the so that no other part of the code can access this data except that function.
Class
Class is a collection objects. It is a user-defined data type, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class. A class is like a blueprint for an object.
A class is a user-defined data-type which has data members and member functions.
In one example of Class Car, the data member will be speed limit, mileage and member functions can apply brakes, increase speed, etc.
Object
Object is a instance of class. when class is defined, no memory is allocated but when it is instantiated memory is allocated.
Object take a space in memory and have an associated address like a record in structure or union in C.
When a program is executed the objects interact by sending messages to one another.
Encapsulation
An encapsulation is process to wrapping of data member and member function in to a single unit.
In encapsulation is binding together the data member and member function. It is know as Encapsulation.
Consider one example in real life example of encapsulation a school bag can keep our notebook, book pen, pencil, etc. means all things are wrapping in to a school bag.
Abstraction
It is a selective ignorance only select essential information.
It is most essential features in object oriented programming language.
Abstraction refers to provided only essential information about the data to the outside world.
Consider the real life example a man driving a car. The man only knows about pressing the accelerators will increase the speed of the car, pressing break to stop the car but he does not know about how pressing accelerator the speed is actually increasing he does not know about inner mechanism of that car.
Inheritance
An Inheritance is process to child access all properties of their parent class and their owns.
The capability of a class to derive properties and characteristics from another class is called Inheritance.
The real life example of inheritance dog, cat, cow be derived class of animal base class.
Polymorphism
Polymorphism means having many forms.
We can define polymorphism as the ability of a message to be displayed in more than one form.
It is features of OOPs that allows the object to behave differently in different conditions.
The real life example of polymorphism, A person at the same time can have different characteristics. like a man at the same time is a father, a husband, an employee. so the same person posses different behavior in different situation.
टिप्पण्या
टिप्पणी पोस्ट करा