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


Please Help Members By Posting Answers For Below Questions

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

798


i have a written test for microland please give me test pattern

2171


What is the function of multilevel pointer in c?

663


Can we use visual studio for c?

536


What are examples of structures?

581






Can you apply link and association interchangeably?

661


Differentiate between new and malloc(), delete and free() ?

657


How to implement a packet in C

2383


What is include directive in c?

632


When is a “switch” statement preferable over an “if” statement?

638


Why doesnt that code work?

596


Explain 'bit masking'?

638


When a c file is executed there are many files that are automatically opened what are they files?

579


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?

594


What is file in c preprocessor?

639