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 fact remains that the human being in early childhood learns to consider one or the other aspect of bodily function as evil, shameful, or unsafe. There is not a culture which does not use a combination of these devils to develop, by way of counterpoint, its own style of faith, pride, certainty, and initiative.
    Erik H. Erikson (1904–1994)

    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)