Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Function pointer
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Pointer that points to a function}} {{Use American English|date=July 2022}} A '''function pointer''', also called a '''subroutine pointer''' or '''procedure pointer''', is a [[pointer (computer programming)|pointer]] referencing executable code, rather than data. [[dereference operator|Dereferencing]] the function pointer yields the referenced [[subroutine|function]], which can be invoked and passed arguments just as in a normal function call. Such an invocation is also known as an "indirect" call, because the function is being invoked ''indirectly'' through a variable instead of ''directly'' through a fixed identifier or address. Function pointers allow different code to be executed at runtime. They can also be passed to a function to enable [[callback (computer programming)|callbacks]]. Function pointers are supported by [[third-generation programming language|third-generation]] [[programming language]]s (such as [[PL/I]], [[COBOL]], [[Fortran]],<ref>{{cite web|url=http://www.esm.psu.edu/~ajm138/fortranexamples.html#ex1|title=Fortran Examples|author=Andrew J. Miller|access-date=2013-09-14}}</ref> [[dBASE]] dBL{{what|date=July 2024}}, and [[C (programming language)|C]]) and [[object-oriented programming]] languages (such as [[C++]], [[C Sharp (programming language)|C#]], and [[D (programming language)|D]]).<ref>{{cite web|url=http://www.newty.de/fpt/intro.html#what|title=The Function Pointer Tutorials|publisher=logo|access-date=2011-04-13|quote=Function Pointers are pointers, i.e. variables, which point to the address of a function|archivedate=2011-05-16|archiveurl=https://web.archive.org/web/20110516153643/http://www.newty.de/fpt/intro.html#what|url-status=deviated}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)