Thursday, 5 November 2015

Difference between Structure and Union?

STRUCTURE UNION 1.The keyword  struct is used to define a structure 1. The keyword union is used to define a union. 2. When a variable is associated with a structure, the compiler allocates the memory for each member. The size of structure is greater than or equal to the sum of sizes of its members. The smaller members may end with unused slack bytes. 2. When a variable...

Wednesday, 29 April 2015

What is name hiding in C++?

Let us understand name Hiding concept with an example: #include<iostream> #include<conio.h> using namespace std; class A { public:     void fun()     {     }     void fun1()     {     } }; class B:public A { public:     void fun()     {     }     void fun1(int x)     {  ...

Tuesday, 28 April 2015

Functions Pointer in C++

Function Pointer are similar to Pointers , Only difference is instead of pointing to a variables , function pointer points to Functions. Let us go through one example for better understanding: int Arr[5] As we know Arr  is constant pointer to an 5 element array , in order to retrieve value we will deference the pointer either by Arr[index] or *Arr, the corresponding Array values...