Header Ads

ad728

C++ tutorial

Introduction to C ++

C ++, as we all know, is an extension of the C language and was developed by Strobe Stroop playing in Bell Labs. C ++ is an intermediate level language, since it verifies the characteristics of the upper and lower level language. C ++ is a compiled language of a general type, well designed, free, multipurpose.

C ++ is an object oriented programming language but is not completely object oriented. Its features, such as Friend and Virtual, violate some very important OOPS features and make this language completely object oriented. This is a medium level language.

Advantages of the C language over C ++
The biggest difference is the concept of UNRWA, C ++ is an object-oriented language, while the C language is a method language. In addition, there are many other features of C ++ that make this language the primary language in C language.

The following features of C ++ make it a stronger language than C,

C ++ has a strong type test.
All features of UNRWA in C ++, such as summary, encapsulation, inheritance, etc. This makes it more desirable and useful for programmers.
C ++ supports and allows user-defined operators (i.e. operator overload), and also supports function overload.
Exception handling is in C ++.
Also constructor and destroyer for virtual functions concept and object.
Online functions in C ++ instead of macros in the C language. Online functions securely build the entire body of the background, just like macros.
Variables can be declared anywhere in the program in C ++, but must be declared before they can be used.

the class
Here we can take humans as a class. Class is a model for any practical entity that describes its properties and functions. As human beings, having organs of the body and performing various actions.

Heritage -
Considering the Human Being class, it has features such as hands, feet, eyes, etc. and functions such as walking, talking, eating, watching, etc. Men and women are also classes, but most features and functions are included in Human Being, so they can inherit everything from the Human Being class using the concept of inheritance.

Objects

My name is Abhishek, and I'm an example / purpose of the male class. When we say, man, man or woman, we mean one type, you, your friend, I am the embodiment of these classes. We are physical beings, while a class is merely a logical definition. We are the object.

Freeze
Abstraction means showing only what the outside world needs while the details are hidden. With our example, man can talk, walk, listen, eat, but his details are hidden from the outside world. By hiding the internal mechanisms, we can take our skin as an abstract factor in our case.

Encapsulation
This example is a little complicated to illustrate with our example. To help our legs move. Included. Our hands help us stop things. This link from features to functions is called encapsulation.

Polymorphism
Polymorphism is a concept that allows the correction of a method of action, either by changing the way it is done or by changing the parts made with it. Both forms have different conditions for them.

If we walk with our hands, not with our feet, here we will change the parts used to do something. Therefore, it is called overhead.



And if there is a definite way to walk, but I want to walk differently, but I use my feet, like everyone else. Then I can do my custom, it will be called cancellation.

UNRWA concept definitions
Now, let's analyze some of the key features of object-oriented programming that you will use in C ++ (technically).

Objects
Lessons
Freeze
Encapsulation
Heritage -
Overload
Discount handling
Objects
Objects are the basic unit of OOP. These classes are examples, in which data are members and use different member functions to perform tasks.

the class
It's like a C language structure. Classes can also be defined as user-defined types of data, but also include functions. So, the class is primarily an aircraft for purpose. Declare and explain what variables will be in the data and what will be implemented on the class object.

Freeze
Abstraction refers to displaying only the required properties of the application and hiding the details. In C ++, classes can provide ways to access and use data variables in the external world, depending on the direct access variable, or classes can make everything accessible to everyone. , Or maybe just using classes that access people.

Encapsulation
You can also say a data link. Encapsulation is about integrating variables and functions into a class.

Heritage -

There is a way to reuse inheritance once you have repeatedly typed the code. The class that inherits is called the base class, and the class that inherits is called the derivative class. They are also called Father Son Classes.

Then, when the derived class inherits the base class, the derived class can use all the functions specified in the base class, making the code reusable.

Polymorphism

This is a feature that allows us to create functions with the same name but different arguments, which will perform different actions. This means, it works with the same name, but it works in different ways. Or it also allows us to redefine a function to provide a completely new definition. You will soon learn how to do this in details in the next tutorial.

Discount handling

Handling exceptions is a feature of OOP, dealing with concessions or unresolved errors that may arise at runtime.

No comments

Post Bottom Ad

ad728