adspace


How do you initialize function pointers? Give an example?

Answer Posted / vadivel t

Initialisation can be done in the following way.

func(int a,int b);
*pfunc(int a, int b);
main()
{

/*here the starting address of the function can be assigned
to a function pointer of the same type*/
pfunc = func;
....
....
....
}
func(int a, int b)
{
....
....
....
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between null and void pointers.

1258


Explain the difference between null pointer and void pointer.

1157


ATM machine and railway reservation class/object diagram

5335


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

2258


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2737


what is ur strangth & weekness

2589


Do you know the difference between malloc() and calloc() function?

1133


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1358


write a c program to find the sum of five entered numbers using an array named number

2247


In C programming, how do you insert quote characters (‘ and “) into the output screen?

1616


Is int a keyword in c?

1057


How do you determine the length of a string value that was stored in a variable?

1203


What is pointers in c with example?

1167


develop algorithms to add polynomials (i) in one variable

2258


write a program to find out prime number using sieve case?

2174