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

Explain logical errors? Compare with syntax errors.

0 Answers  


Is it possible to use curly brackets ({}) to enclose single line code in c program?

0 Answers  


Here is a good puzzle: how do you write a program which produces its own source code as output?

0 Answers  


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

0 Answers  


Determine if a number is a power of 2 at O(1).

2 Answers  






out put of printf(ā€œ%dā€,printf(ram));

5 Answers  


program that accepts amount in figures and print that in words

2 Answers   Infosys, Lovely Professional University, Wipro,


Write a c program to enter a string of paragraph and replacing a particular word which is repeated in the paragraph by another word?

2 Answers   ME, Synfusion, Wipro,


What is meant by int fun const(int a, int b) { .... ... }

1 Answers  


What is the purpose of void in c?

0 Answers  


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

0 Answers   Aegis, CDAC, Infosys,


can we implement multi-threads in c.

0 Answers  


Categories