Best Answer

Function Pointers are basically used when we want to select a function which is to be used dynamically at run time.

AnswerFunction pointers are the only way for "Interept programming". In UNIX all the Interepts are called using function pointers. This is mainly used in system programming. Answerits nothing but a pointer to function. which is similar to ptr to a variable, if we are saying ptr to a variable then it will hold address of the variable like that fn. ptr will have the address of the function..

one of the major application of the function pointer is call back function.. i.e callback.

AnswerPointers to functions/methods/subroutines aka 'Delegates' are frequently used in .NET programming especially in EventHandling, MemberInvoking


A function pointer is used to pass a function as an argument to another function, or to store a function as a data item, for example a list of functions can be implemented as an array of pointers to functions. Function pointers are used to store interrupt handlers in tables.

User Avatar

Wiki User

โˆ™ 2010-06-09 04:47:41
This answer is:
User Avatar
Study guides
See all Study Guides
Create a Study Guide

Add your answer:

Earn +20 pts
Q: What is the main use of the function pointer?
Write your answer...
Related questions

What is the difference between a function pointer and a pointer to a function?

A pointer to a function is the memory address that stores the address of a function, while the pointer itself is a function pointer.A pointer to a function might be defined as "int (*pf)(int, int);", while to actually point to the function, you would use a function pointer, such as "pf = &func;".

What is the difference bw function pointer and function of pointer?

function pointer is a variable that hold the address of any function which declared in the program but function pointer is the array of the function that accept the run time size of the function.

Pointer to pointer in c?

Usable. A prominent example is param argv of function main.

What is the Use of static function?

A static function is a member function that is not associated with any instance of the class; it has no this pointer.

What do you mean by function to pointer?

Nothing. You might have meant pointer-to-function.

How can you declare a pointer function?

*function();this declares a pointer function!

What is the main function of the cells indicated by the black pointer?

regulate the rate of gas exchange

How do you create a pointer to an array of function pointers?

You point at the array the same way you would with an array of any pointer type, by using an additional level of indirection than is employed by the pointers in the array itself. In this case, the array contains pointer-to-function data types (with one level of indirection), thus you must use a pointer-to-pointer-to-function data type (with two levels of indirection) in order to point at the array itself. Had the array contained pointer-to-pointer-to-function data types (where each pointer points to a separate array of pointer-to-function data types), then you'd use three levels of indirection, and so on. You increase the level of indirection by placing an additional asterisk before the pointer's name when you declare the pointer. That is, one asterisk per level.

Can you use pointers in c language?

Yes. For example, argv parameter of function mainis a pointer to an array of pointers to characters.

What is pointer to function in c?

Pointer in C is Memory Reference. It stores memory address of any variable, constant, function or something you later use in your programming. Pointer basically used to ease the referencing of variables and others or in polymorphism and inheritance.

What is the main function of a computer mouse?

To aid in the use of the computer by allowing you to move a pointer around the screen and do things much faster than just using a keyboard

What are the specific uses of pointer to pointer?

A pointer to pointer variable can hold the address of another pointer variable. The Syntax is as follow: type** variable; Example:: //function prototype void func(int** ppInt); int main() { int nvar=2; int* pvar=&nvar; func(&pvar); .... return 0; }One more important use of pointer-to-pointer is for creating multi-dimensional array dynamically, see See the related links.

Can a function return a pointer?

Yes. A function can return a pointer... const char* GetHelloString() { return "Hello!"; } ... returns a pointer to the string "Hello!".

On a triple beam balance what is the function of the pointer?

It is to show you that the pointer is on the zero mark.

Why you use main function in c?

Because if you donot use main function in c program, the compiler willnot execute the program.C compiler starts execution from main function itself.

Use of double pointer?

A double pointer has two basic meanings. One is ofa pointer to a pointer, where changing the value ofdouble pointer will result in the original pointer being changed. Another is that of a two-dimentional array, such as a matrix, or a list of char* (e.g. in main when you use argv).

What are the types of pointers in C plus plus?

Pointer variables and function pointers are the two primary types, as well as a void pointer (unknown type). Pointer variables can point to any valid type, including primitive types and user-defined types, as well as other pointer variables. Function pointers can point to any function with the same signature as the function pointer itself. Void pointers can point anywhere.

Can you use main function as a recursive function in C?


Why you use double pointer instead of pointer?

Double pointers are better known as pointer-to-pointer types. You use pointers to store the memory address of an object but when the object is itself a pointer, you need to use a pointer-to-pointer in instead. Pointer-to-pointer types are typically used when passing pointers into functions. Pointers allow you to pass objects to functions by reference but the pointer itself is passed by value. If you want to pass the pointer by reference, you need to pass a pointer-to-pointer.

Which function is used to determine the position of the put pointer in a file in c plus plus?

The function ftell returns the position of the file pointer for a file.

What is the use of main function in C programming?

main function is the function which comes under user defined function through which we can execute a program .That means without main function we cann't execute a programThough main function is the user defined function but it has the highest priority to execute a program.But we can execute a function without main by using the macro #pragma

What is the use of pointer?

To point with. 1. To manipulate parts of an array. 2. To return more than value from a function.

How do you declare pointer to function in c?

typedef int (*myfunptr)(int argc, char **argv); myfunptr m= main;

What is pointer variable explaine?

If you mean example, then it is argv, which is the second parameter of function main.

Function pointers example programs?

A pointer which keeps address of a function is known as function pointer. example: { void *(*ptr)(); ptr= &amp;display; (*ptr)(); return(0); } void display() { .................. )