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
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
i have a written test for microland please give me test pattern
What is the function of multilevel pointer in c?
Can we use visual studio for c?
What are examples of structures?
Can you apply link and association interchangeably?
Differentiate between new and malloc(), delete and free() ?
How to implement a packet in C
What is include directive in c?
When is a “switch” statement preferable over an “if” statement?
Why doesnt that code work?
Explain 'bit masking'?
When a c file is executed there are many files that are automatically opened what are they files?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is file in c preprocessor?