How do I initialize a pointer to a function?

Answers were Sorted based on User's Feedback



How do I initialize a pointer to a function?..

Answer / 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

How do I initialize a pointer to a function?..

Answer / k.thejonath

void (*)f();
Here f if is pointer to a function having no arguments and
no return values.

Is This Answer Correct ?    7 Yes 8 No

Post New Answer

More C Interview Questions

code for replace tabs with equivalent number of blanks

0 Answers   Bosch,


find largest of 3 no

8 Answers  


what is the difference between <stdio.h> and "stdio.h"

14 Answers   Invendis, Kanbay, Mastek, MathWorks,


Are the variables argc and argv are local to main?

0 Answers   TISL,


What is a constant?

0 Answers  


c program to add and delete an element from circular queue using array

3 Answers  


Write a program to give following output..... ********* **** **** *** *** ** ** * * ** ** *** *** **** **** *********

4 Answers  


Why doesnt the call scanf work?

0 Answers  


what is the output of printf("%d",(scanf("%d",10));

10 Answers  


what is the difference between NULL('\0') and 0?

14 Answers   Microsoft,


What does & mean in scanf?

0 Answers  


C passes By value or By reference?

5 Answers   Geometric Software, Infosys,


Categories