answersLogoWhite

0


Best Answer

void (*funptr)(void);

void fun (void);

int main ()

{

funptr = fun;

funptr ();

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A pointer to a function which receives nothing and returns nothing?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

A pointer to function which receives an int pointer and returns a float pointer?

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


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 falloc?

falloc is a function similar to malloc. Where the function malloc returns a pointer to an area of memory, falloc returns a "far" pointer to a "far" area of memory; i.e., memory that goes beyond the segmented memory limitations inherent to x86 memory architecture.


How will you declare an array of three functions pointer where each function receives two ints and returns a float?

typedef float (*pt_func)(int, int); pt_func arr[3];another way:float (*pt_func[3])(int, int);


Why is returning a pointer to a local variable a logical error?

Local variables automatically fall from scope when a function returns. If the function returns a pointer to one of its local variables and you subsequently attempt to dereference that pointer, you introduce undefined behaviour into your program. With undefined behaviour you have no way of knowing what will happen: the program may work; the program may crash; the program may wipe the user's hard-drive. Anything can happen when you introduce undefined behaviour into a program.


What is dangling pointer reference in c plus plus?

A dangling pointer (we also use the terms stray pointer and wild pointer) is created whenever we call delete on a pointer and then try to use the pointer without reassigning it.We can also create dangling pointers inadvertently by calling a rogue function that returns a pointer to an object that is local to the function we are calling. The object will fall from scope when the function returns so the pointer is left dangling.Note that there is no such thing as a dangling pointer reference. Pointers and references are not the same. A reference is merely an alias to an object -- it consumes no memory beyond the object it refers to. Whereas a pointer is a variable that may contain the address of an object, but it requires additional memory to do so (4 bytes on 32-bit architecture). Pointers may be NULL, references can never be NULL. Pointers to valid objects require indirection, references do not. References are the preferred method of accessing an object's members, not least because they are easier to work with.


Can you use the PMT function in Excel to display dates in many different formats?

The PMT function returns the payment amount for a loan, so it has nothing to do with how dates are displayed. It returns numbers.


How to use free with respect to malloc?

If malloc() returns a pointer to space for an object of size size1(or NULL if the request cannot be satisfied) when invoked that returned pointer can be assigned to a pointer varialbe P of respective type *P; P=malloc(size1); if the above function call is successful P points to space of size size1 That memory space can be freed as free(p); free deallocates the space pointed to by p; it does nothing if p is NULL


Which is the unary operator used to dereference a pointer and return the value stored in it?

The asterisk (*) operator dereferences a pointer and returns the value stored in the memory pointed to by the pointer.


Is void a data type in c?

what is void data type Void is an empty data type normally used as a return type in C/C++, C#, Java functions/methods to declare that no value will be return by the function. The another use of void is to declare the pointer in C/C++ whe It is not sure that what data type will be addressed by the pointer. eg: void *p; Here p can hold the address of int or float or char or long int or double.


What is the malloc function?

The malloc function is one of a group of memory allocation functions; malloc, calloc, realloc, and free. Specifically malloc (size) returns a pointer to a new memory block of at least size bytes, suitably aligned for optimum access for any basic type, or it returns a NULL if the request cannot be satisfied.


A function takes the exponential function's output and returns the exponential function's input?

A __________ function takes the exponential function's output and returns the exponential function's input.