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
explain Storage management: free storage pool, garbage collection, compaction, boundary tag method; Hash tables and hashing functions

Stage One Define the specification of the program            Add two nxm size matrices   Stage Two Divide the program up into separate modules           Input Matrix         Ad

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.

What is Union? Intimately associated with the structure is the union which as well contains multiple members. Unlike a structure but the members of a union share the same stora

decodes the sending smuggler string from the number format into plain text

Aim: To implement a program to swap two numbers using reference arguments. Code: void swap(int *a, int *b) {             int temp;             temp=*a;

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 technology, they are send

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 between two points can b

d county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Necklaces

Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele