Core c++ concepts of Pointers

Pointer to  Function.

As we use pointer to carry address of variable,also we discussed  pointer to array ,where we assigned pointer to array(pointer pointing to first address of array), similarly pointer can also be used to point to  function by carrying address of the function it points.

Declaration of Function Pointer


data_type(*ptr_name)(arg_list)


data type: data type /return type of member function.

*ptr name: name of the pointer which is pointing to function.

arg_list: List of arguments that function is having.

Read moreCore c++ concepts of Pointers

Pointers

Introduction to Pointers

As we all know every variable in C++ has a name and a value.So when we declare a variable , a specific block of memory is allotted to hold its value.Also the size of that variable depends upon the data type  of that variable.


for ex: int a=10;

here variable a is of integer data type and its value is 10 .


Read morePointers