How do I initialize a pointer to a function?

Answer Posted / jaya prakash

return_type (*pointername)(arg list)

eg
void fnname();
void (*f)()=fnname;//ptr initialisation
//f is the poniter to fn printf

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by a local block?

625


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1207


What is the meaning of 2d in c?

604


How can I read data from data files with particular formats?

597


What is actual argument?

585






How is a null pointer different from a dangling pointer?

555


Explain the Difference between the New and Malloc keyword.

680


Explain what is the most efficient way to store flag values?

692


how is the examination pattern?

1591


What is the meaning of typedef struct in c?

584


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3726


FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

615


How can I rethow can I return a sequence of random numbers which dont repeat at all?

700


Write a code on reverse string and its complexity.

600


How would you rename a function in C?

612