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
write a c progrm to find area under the cuve y=f(x)   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; in

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b

You're going to simulate a metropolitan subway train.  The train system will start out at Station #1, or Home  Station, and will service multiple stations along its route.

How do one throw polymorphically?               A: Sometimes people write code such as: class MyExceptionBase { }; class MyExceptionDerived : public MyExceptionBase { };


Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw .

Problem Description Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new techn

write c++ program to decode the given code. in mobile keypad the integers from 1 to 9 will display the characters from a to z and 0 will assign a space

Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process wi

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: