How do you initialize function pointers? Give an example?
Answer Posted / vadivel t
Initialisation can be done in the following way.
func(int a,int b);
*pfunc(int a, int b);
main()
{
/*here the starting address of the function can be assigned
to a function pointer of the same type*/
pfunc = func;
....
....
....
}
func(int a, int b)
{
....
....
....
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to get string length of given string in c?
What is 1f in c?
Can a variable be both static and volatile in c?
What are the various types of control structures in programming?
What do the functions atoi(), itoa() and gcvt() do?
What do you mean by invalid pointer arithmetic?
Is c language still used?
Can we assign string to char pointer?
What is typedf?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
Explain the process of converting a Tree into a Binary Tree.
What is line in c preprocessor?
What are the salient features of c languages?
What is the right type to use for boolean values in c? Is there a standard type?
How do you redirect a standard stream?