Inline function: Inline function is an important feature that is commonly used with classes. If a function is inline, the compiler places a copy of the code of that function …
Read More »Difference between call by value and call by reference
Difference between call by value and call by reference Call by value Call by Reference A copy of value is passed to function An address of value is passed to …
Read More »OOP Code Example of Call By Reference and Return By Reference
Call by reference void swap(int &x, int &y) { int temp = x; x = y; y = temp; cout<<x<<”\\”<<y<<endl; } int main() { int main x = 6; swap(m,n); …
Read More »Difference between Reference variable and Pointer variable
Difference between Reference variable and Pointer variable Reference Variable Pointer Variable A reference can be used directly A pointer needs to deference with * to access memory location A reference …
Read More »Define Reference variable and Example
Reference variable A reference variable in C++ is a variable that acts an alias to another variable Syntax: data_type &ref_var = previous_var ; Example: int main(){ int x = 5; …
Read More »Advantages of Encapsulation, Abstraction, Inheritance, Polymorphism
Advantages of Encapsulation Reduces human errors. simplifies the maintenance of application. Advantages of Abstraction Avoid code duplication and increase re-usability. Helps to increase security of an application. Advantages of Inheritance …
Read More »Define Object, Class, Encapsulation, Abstraction, Inheritance, Polymorphism
Define Object In Object oriented programming an object is a self-contained component that contains properties and methods to make a certain data type. Define Class Class is a blueprint or …
Read More »Advantages of Function overloading, Constructors, Destructors, constructor, Overriding
Mention the advantages of Function overloading Overload method give programmes the flexibility. It speed up the execution of program. Mention the advantages of Constructors It initialize an object. We can …
Read More »Mention drawbacks of C programming. How can the drawbacks be resolved by OOP paradigm?
Drawbacks of C programming lack of encapsulation some code repetation lack of information hiding not much reusability of code absent inheritance It can be solve by using the concept of …
Read More »How a C++ program can be structured using the concept of OOP ?
A C++ program can be structured using the concepts of OOP given below – Class Object Abstraction Encapsulation Data hiding Inheritance Polymorphism Message Passing.
Read More »