what is a function pointer and how all to declare ,define
and implement it ???
Answer Posted / mathiyazhagan
A function can itself stored in a memory address.By calling
the address ,instead of function name,we can invoke
function.
Eg.:
#include <stdio.h>
void sum(int,int);
{
void (*fp)(); //() denotes pointer to a function
fp=sum(); // no need & .reason : same of array
fp(10,20); //invoking function
}
void sum(int x,int y)
{
printf("sum of x%d and %d is =%d",x,y,x+y);
}
| Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
what is use of malloc and calloc?
What is I ++ in c programming?
write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.
What are the types of type qualifiers in c?
List the variables are used for writing doubly linked list program.
What is "Duff's Device"?
What are types of preprocessor in c?
What is 1d array in c?
How can you find the day of the week given the date?
what is the diffrenet bettwen HTTP and internet protocol
Write a program to check whether a number is prime or not using c?
What is an lvalue in c?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
What is the use of sizeof?
What are the advantages of using new operator as compared to the function malloc ()?