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

What are the 4 types of unions?

0 Answers  


i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me

0 Answers   Microsoft,


How many types of errors are there in c language? Explain

0 Answers  


write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101)

1 Answers   Bosch, College School Exams Tests,


Write a program to swap two numbers without using the third variable?

0 Answers  






player is good if the following conditions are satisfied: He is either from “India”, “Japan” or “Korea” He has a minimum of 3 years of experience He has won at least 3 major tournaments, and one of them must be "World Championship Tournament". He must know more than 10 techniques. (but see next question) If he knows less than 10 techniques, then he must be a world champion. His name contains at least 3 words. For example "Sachin Tendulkar" will not meet this condition. Write a method: boolean isGoodPlayer(String name, String country, int yearsExperience, String[] majorTournamentsWon, String[] techniques, boolean isWorldChampion) name country yearsExperience majorTournamentsWon techniques isWorldChampion

1 Answers  


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

0 Answers  


List out few of the applications that make use of Multilinked Structures?

1 Answers   Accenture,


Explain high-order and low-order bytes.

0 Answers  


how 2 compile & execute c program with out using editor?

2 Answers   HP,


Explain how are portions of a program disabled in demo versions?

0 Answers  


What do header files do?

0 Answers  


Categories