what is a function pointer and how all to declare ,define
and implement it ???
Answer Posted / satish
Function pointer:
a function can be called not only by
its name,but also by other name which is called function
pointer.
void fact(int);
void main()
{
void(*p)(int);
printf("Enter n\n");
scanf("%d",&n);
p=fact;
fact(n);/*normal calling a function*/
(*p)(n); /*fn calling using function pointer*/
}
void (*p)(int n)
{
int ans=1;
while(n>0)
{
ans*=n--;
}
printf(" %d != %d",n,ans);
Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
Explain how do you generate random numbers in c?
Explain what are linked list?
What is chain pointer in c?
How many types of arrays are there in c?
Mention four important string handling functions in c languages .
pierrot's divisor program using c or c++ code
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What are the advantages of external class?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
program to convert a integer to string in c language'
Explain the ternary tree?
Why can arithmetic operations not be performed on void pointers?
What are the 4 types of programming language?