views:

132

answers:

4

Id like to know what excatly is a hook function. Explanation and example in php, c++, or java is fine.

+3  A: 

http://en.wikipedia.org/wiki/Hooking

Kezzer
A: 

Google is your friend.

If you have specific queries, post them back, but there are tons of good overviews with examples (for example, the Wikipedia article that's the first result).

Andrzej Doyle
only has a C# example.
Sam
+1  A: 

It is a way or customising the handling of some event or process. So for example if you have a timer service, you might provide a hook function that is called by the service to handle the timer event. In this way, the client defines the handling rather than the client having to conform to some hard-coded server interface.

Clifford
A: 

In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components.

talentsfromindia
I think you should mention it when you quote Wikipedia, out of courtesy. Otherwise it feels like a plagiarism.
FireAphis
especially if the Wikipedia link is given as the first answer (almost 30 minutes ago)!
Carlos Heuberger