what is a function pointer and how all to declare ,define
and implement it ???

Answer Posted / swagatika

function pointer is function returning a pointer
Example-

int *sum(int a, int b)
{
int x;
x= a+b;
return &x;
}

but the pointer to a function means a function interm of
pointer pointing to the another function.

int (*sum)(sum1);//pointer to a function

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When we use void main and int main?

822


What is volatile c?

773


What is break statement?

857


What is conio h in c?

814


How to write a code for reverse of string without using string functions?

1837


Tell us something about keyword 'auto'.

841


What is pragma in c?

856


Difference between pass by reference and pass by value?

869


Why header file is used in c?

782


Add Two Numbers Without Using the Addition Operator

561


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

867


Why does everyone say not to use gets?

803


How does selection sort work in c?

811


Write a program to check whether a number is prime or not using c?

804


I need testPalindrome and removeSpace #include #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }

2439