Skip to content

madhurimarawat/Object-oriented-programming-with-c-plus-plus

Repository files navigation

Object-oriented-programming-with-c-plus-plus

This repository contains programs in the C++ programming language related to Object Oriented programming.


About C++ Programming

--> C++ is a cross-platform language that can be used to create high-performance applications.

--> C++ was developed by Bjarne Stroustrup, as an extension to the C language.

--> C++ gives programmers a high level of control over system resources and memory.

--> C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs.


Mode of Execution used

GCC Compiler

--> GCC stands for GNU C/C++ Compiler.

--> To begin with GCC, visit the official website  

--> Download GCC according to the platform being used like Linux, MacOs or Windows.

--> Follow the setup wizard.

--> Write c++ code in any text editor or IDE and save it with .cpp extention.

--> Then just open the console and run this command -

g++ filename.cpp -o Output

--> Filename is the name of the C++ script file and Output is the name of the output file.

--> After this command is executed, if the code is successfully compiled output file will be saved in the same location as the code file.

--> Once this Output file is executed in command prompt, the output will be displayed.


C++ Programming Features


Object Oriented Programming


Class

--> The building block of C++ that leads to Object-Oriented programming is a Class.

--> 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.

Object

--> An Object is an identifiable entity with some characteristics and behavior.

--> An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is instantiated (i.e. an object is created) memory is allocated.

Data Abstraction

--> Data abstraction is one of the most essential and important features of object-oriented programming in C++.

--> Abstraction means displaying only essential information and hiding the details.

Data Encapsulation

--> In normal terms, Encapsulation is defined as wrapping up data and information under a single unit.

--> In Object-Oriented Programming,Encapsulation is defined as binding together the data and the functions that manipulate them.

Polymorphism

--> The word polymorphism means having many forms.

--> In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form.

Inheritance

--> The capability of a class to derive properties and characteristics from another class is called Inheritance.

--> Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class.

Dynamic Binding

--> In dynamic binding, the code to be executed in response to the function call is decided at runtime.

--> C++ has virtual functions to support this.

--> Because dynamic binding is flexible, it avoids the drawbacks of static binding, which connected the function call and definition at build time.

Message Passing

--> Objects communicate with one another by sending and receiving information.

--> A message for an object is a request for the execution of a procedure and therefore will invoke a function in the receiving object that generates the desired results.

--> Message passing involves specifying the name of the object, the name of the function, and the information to be sent.

Thanks for Visiting 😄

Drop a 🌟 if you find this repository useful.

If you have any doubts or suggestions, feel free to reach me.

📫 How to reach me:   Linkedin Badge     Mail Illustration📫

About

This repository contains programs in the C++ programming language related to Object Oriented programming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages