Pointer to function, C/C++ Programming

Pointer to function:

int mul(int a, int b, int c)

{

  return a*b*c;

}

void main()

{

  int (*function_pointer)(int, int, int);

  function_pointer = &mul;

  printf("\nThe product of three numbers is:%d", function_pointer(8, 3, 4));

  getch();

}

Output

859_pointer to string.png

Posted Date: 9/29/2012 7:02:21 AM | Location : United States







Related Discussions:- Pointer to function, Assignment Help, Ask Question on Pointer to function, Get Answer, Expert's Help, Pointer to function Discussions

Write discussion on Pointer to function
Your posts are moderated
Related Questions
Default Arguments A default argument is a value that is automatically assigned to a formal variable, if the actual argument from the function call is omitted. e.g. void

Q-What is your reaction to following line of code?               delete this; A: This is not a good programming Practice. A good programmer will insist that you must absolute

write a program to calculate gross salary and net salary using hra da pf in c++

How can I handle a destructor that fails? Need help please provide example also.

Operator Overloading Fundamentals The C language uses the concept of Operator Overloading discreetly. The asterisk (*) is used as multiplication operator as well as indirect

C program to define power of a function: Write a program to use power of a function. void main() { int x,y,po=1,i,j; clrscr();   printf("Give x,y\n"); sca

Question 1 Describe the following with respect to pointers in C language- Pointers and Arrays Usage of Pointers in functions Write programs in C to demonstrate the

b) The static keyword let a variable to maintain its value among distinct function calls. If the value of a static variable alters while the variable has been accessed, variable

Want a scraping program created Project Description: We need to hire a professional developer to scrape the site for information such as *product title *Product Price

Program is to store all ASCII char into a file: void main()     {   ofstream  fout("ascii.txt");   int i,n=256;   for(i=1;i     {     fout     }