SE250:HTTB:Pointers:Function pointers

From Marks Wiki
Revision as of 05:09, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (3 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<html>

<image src="http://www.rajithaonline.com/SE250/httb/pointers/final/function_pointers_head.png" width="385" height="92" alt="Function Pointers Header Logo" />

</html>

Previous Page Contents Next Page



Function Pointers

A pointer to a function contains the address of a function in memory. As an array name is really the address in memory of the first element of the array, a function name is really the starting address in memory of the code which is the function. Pointers to functions can be passed to functions, returned from functions, stored in arrays and assigned to other function pointers.

A pointer to a function is dereferenced to use the function, similar to how a pointer to a variable is dereferenced to access the value of the variable.


Previous Page Contents Next Page