by Dinesh Thakur Category: Classes in C++

1: Public, protected and private are three access specifier in C++. Public data members and member functions are accessible outside the class. Protected data members and member functions are only available to derived classes. Private data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes. Write a function that swaps the values of two integers, using int* as the argument type.

 
by Dinesh Thakur Category: Classes in C++

Friend classes are used when two or more classes are designed to work together and need access to each other's implementation in ways that the rest of the world shouldn't be allowed to have. In other words, they help keep private things private. For instance, it may be desirable for class DatabaseCursor to have more privilege to the internals of class Database than main() has.

 
by Dinesh Thakur Category: Classes in C++

Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.

 
by Dinesh Thakur Category: Classes in C++

Class : Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class. Class is a successor of Structure. By default all the members inside the class are private.



 
by Dinesh Thakur Category: Classes in C++

1: constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized.

 
by Dinesh Thakur Category: Classes in C++

Objects are the small, self-contained and modular units with a well-defined boundary. An Object is a Real Word Thing Which performs a Specific Task. An object consists of a state (Properties) and behavior (Method). The state of an object is one of the possible conditions that an object can exist in and is represented by its characteristics or attributes or data or Properties of Object. The behavior of an object determines how an object acts or behaves and is represented by the operations that it can perform. In OOP, the attributes of an object are represented by the variables and the operations are represented by the functions.

 
by Dinesh Thakur Category: Classes in C++

Overloading: When a single Object has multiple behaviors. Then it is called as Overloading. Overloading is that in which a Single Object has a same name and Provides Many Functions. In Overloading followings things denotes Overloading:-

 
by Dinesh Thakur Category: Classes in C++

Early Binding:Early Binding Always Occur in the Polymorphism, when we pass the Reference of a sub Class into the Pointer Object of Base Class, then the Member Functions Are never to be Override. When we execute the Program then Compiler knows this thing. This is called as Early Binding. And the Compiler will Execute the Member Functions of Base Class and this will never overrides the Body of the Sub Class Member Function. This is known as the early binding.

 
by Dinesh Thakur Category: Classes in C++

In the Inheritance when we Points or Pass the Reference of Second Class Object into the Pointer Object of First Class , then the Pointer object of first class will call only the Constructor of Sub Class But Destructors are not Called With the help of Base Class Pointer Object. Because the Statements or Destructors of Base Class are never Override.

 
by Dinesh Thakur Category: Classes in C++

In the Hierarchical Inheritance, when we use The Same Data Member in the Sub Class Then the Data Member will Contains the Many values So that here Data Member will be Ambiguous Because a Single Data Member have two or more values.

 
by Dinesh Thakur Category: Classes in C++

We know that C++ is an OOP language that is code of C++ may Contains classes there is a main Method which also Reside in Class.

 
by Dinesh Thakur Category: Classes in C++

Storage Classes are used to determine in which space the value of variable will Stored. And what will be the value of variable, when we doesn’t Specify the value of variable. And In what Place we can use the value of variable. The Storage Classes Determines the Following things.

 

Page 5 of 6



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles