Major Features of C++
Thread Tags
Adobe Illustrator Adobe InDesign Adobe Photoshop Android Development Android Programming Android Studio Automation Testing bitmap file Brochure design C / C++ Programming Career Option Career Options College Lounge css CSS/HTML sandbox digital marketing Digital Marketing / SEO Fireworks Graphic Design Graphic designing Graphics Design Graphics Designing HTML? Illustrator Internship Training Liquify Tools logo Design logo designing Mobile UI Development Photoshop QA react-native Responsive Design SEO Testing Typography UI UI/UX Development UI Design UI Designing UI development User Interface UX Design Web Designing Website Design-
Register for free!
Registration at Smart Mentors is completely free and takes only a few seconds. By registering you’ll gain:
- Full Posting Privileges.
- Access to Private Messaging.
- Optional Email Notification.
- Ability to Fully Participate.
Register Now, or check out the Site Tour and find out everything Smart Mentors has to offer.
Tagged: C / C++ Programming
This thread contains 1 reply, has 2 voices, and was last updated by Test 5 years, 7 months ago.
-
Author Replies
-
-
January 30, 2019 at 10:25 am #52872
This primarily preferred standpoint of C++ is, it is an object-oriented programming language. It pursues the idea of oops like polymorphism, inheritance, encapsulation, abstraction.
Major Features of C++ are as follows: –
1) Class: Class is a blueprint of data and functions or methods. Class does not take any space.
A class in C++ contains, following properties;
(i) Data Member
(ii) Method
(iii) Constructor
(iv) Block
(v) Class and Interface2) Object: Objects are basic run-time entities in an object-oriented system, objects are instances of a class these are defined user-defined data types.
An Object in C++ has three characteristics:
(i) State
(ii) Behavior
(iii) Identity3) Encapsulation: Wrapping up(combining) of data and functions into a single unit is known as encapsulation. The data is not accessible to the outside world and only those functions which are wrapping in the class can access it. This insulation of the data from direct access by the program is called data hiding or information hiding.
Example of Encapsulation in C++
#include<iostream.h>
#include<conio.h>class sum
{
private: int x,y,z;public:
void add()
{
clrscr();
cout<<“Enter any two numbers: “;
cin>>x>>y;
z=x+y;
cout<<“Sum: “<<z;
}
};
void main()
{
sum s;
s.add();
getch();
}
Output
Enter any two number:
1
2
Sum: 34) Data abstraction: Abstraction is the concept of exposing only the required essential characteristics and behavior with respect to a context.
Hiding of data is known as data abstraction. In an object-oriented programming language, this is implemented automatically while writing the code in the form of class and object.
Example of Abstraction in C++
#include<iostream.h>
#include<conio.h>class sum
{
// hidden data from outside world
private: int x,y,z;public:
void add()
{
clrscr();
cout<<“Enter any two numbers: “;
cin>>x>>y;
z=x+y;
cout<<“Sum: “<<z;
}
};
void main()
{
sum s;
s.add();
getch();
}
Output
Enter any two number:
2
3
Sum: 5Note:
i) Data abstraction can be used to provide security for the data from the unauthorized methods.
ii) In C++ language data abstraction can be achieved by using class.5) Inheritance: The process of obtaining the data members and methods from one class to another class is known as inheritance. It is one of the fundamental features of object-oriented programming.
Syntax
class subclass_name : superclass_name
{
// data members
// methods
}6) Polymorphism: Polymorphism means the ability to take more than one form. An operation may exhibit different behaviors in different instances. The behavior depends upon the types of data used in the operation.
7) 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.
8) Message Passing: Objects communicate with one another by sending and receiving information to each other. A message for an object is a request for 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.
-
AuthorPosts
You must be logged in to reply to this thread.Please login or register. Registration is 100% free.