Software and Applications (non-game)
Computer Programming

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

Top Answer
User Avatar
Wiki User
Answered 2008-10-16 13:49:51

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.

User Avatar

Your Answer

Related Questions

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;".

There is no similarity between the two.

*function();this declares a pointer function!

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

difference between pointer or structure

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

1. pointer to a constant means you can not change what the pointer points to 2. constant pointer means you can not change the pointer.

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

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

Pointer-variables are variables, so there is no difference.

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.

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

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

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.

float *(*funptr)(int *); float *fun (int *); funptr= fun;

Generic pointer of type 'void *' is compatible with any (data-)pointer, but you cannot use the following operators on it: + - ++ -- += -= * -> []

// declare a function int* function(int, int); or int* (function)(int, int); // declare a pointer to a function int* (*pointer_to_function)(int, int);

Pointer holds an address Array holds values

The former is variable, the latter is constant.

The difference that i learnt very recently and the one i remember :-)Reference cannot be changed whereas pointer value can be changed.Actually, const pointer = reference.

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

Yes, C++ supports function pointers.

A void pointer is a pointer that has no type information attached to it.A null pointer is a pointer that points to "nothing". A null pointer can be of any type (void included, of course).

Stack pointer points to the topmost / most recently referenced location on the stack; - Nutan

Copyright ยฉ 2021 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.