Pointer (computer Programming) - Function Pointer

Function Pointer

In some languages, a pointer can reference a function. The function pointer will store the address location of the function to be invoked. While this facility can be used to call functions dynamically, It is often the favorite method of virus and other malicious software writers. For example, in C it is possible to define a function pointer.

int a,b,x,y; int sum(int no1,int no2); // Function with two integer arguments which returns an integer value int (*fp)(int,int); // Function pointer which can point to a function like sum fp = ∑ // fp now points to Function sum x = (*fp)(a,b); y = sum(a,b); // Both lines call the function sum with parameters a and b

Read more about this topic:  Pointer (computer Programming)

Famous quotes containing the words function and/or pointer:

    “... The state’s one function is to give.
    The bud must bloom till blowsy blown
    Its petals loosen and are strown;
    And that’s a fate it can’t evade
    Unless ‘twould rather wilt than fade.”
    Robert Frost (1874–1963)

    The hardiest skeptic who has seen a horse broken, a pointer trained, or has visited a menagerie or the exhibition of the Industrious Fleas, will not deny the validity of education. “A boy,” says Plato, “is the most vicious of all beasts;” and in the same spirit the old English poet Gascoigne says, “A boy is better unborn than untaught.”
    Ralph Waldo Emerson (1803–1882)