| example
code | https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(compileOnChange:'0'),source:'%23include+%3Cstddef.h%3E%0A%0A/*+Declare+a+simple+function+that+takes+one+integer%0A+++argument+and+returns+an+integer.+*/%0Astatic+int+my_function(int+foo)%3B%0A%0A/*+Define+a+global+variable+named+%22my_function_pointer%22%0A+++whose+type+is+a+pointer+to+a+function+that+takes+one%0A+++integer+argument+and+returns+an+integer.+Initialize%0A+++this+to+NULL.+*/%0Aint+(*my_function_pointer)(int)+%3D+NULL%3B%0A%0Aint+main(void)+%7B%0A++/*+Point+the+function+pointer+to+the+simple+function+*/%0A++my_function_pointer+%3D+my_function%3B%0A%0A++/*+Invoke+the+function+via+the+global+function%0A+++++pointer+variable.+*/%0A++return+my_function_pointer(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.*/%0Astatic+int+my_function(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-x+c+--std%3Dc99'),l:'5',n:'0',o:'%231+with+x86-64+clang+(trunk)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| example
code | https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(compileOnChange:'0'),source:'/*+Declare+a+simple+function+that+takes+one+integer%0A+++argument+and+returns+an+integer.+*/%0Astatic+int+my_function(int+foo)%3B%0A%0A/*+Define+a+global+variable+named+%22my_function_pointer%22%0A+++whose+type+is+a+pointer+to+a+function+that+takes+one%0A+++integer+argument+and+returns+an+integer.+Limit+its%0A+++visibility+to+this+translation+unit+and+make+it%0A+++const.+Initialize+it+to+point+to+the+simple+function%0A+++declared+above.+*/%0Astatic+int+(*+const+my_function_pointer)(int)+%3D+my_function%3B%0A%0Aint+main(void)+%7B%0A++/*+Invoke+the+function+via+the+global+function%0A+++++pointer+variable.+*/%0A++return+my_function_pointer(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.*/%0Astatic+int+my_function(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-x+c+--std%3Dc99'),l:'5',n:'0',o:'%231+with+x86-64+clang+(trunk)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| example
code | https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(compileOnChange:'0'),source:'/*+Declare+two+simple+functions+that+each+take+one%0A+++integer+argument+and+return+an+integer.+*/%0Aint+my_function1(int+foo)%3B%0Aint+my_function2(int+foo)%3B%0A%0A/*+Define+a+global+variable+named+%22my_function_pointers%22%0A+++whose+type+is+an+array+of+pointers+to+functions+that+%0A+++each+take+one+integer+argument+and+return+an+integer.%0A+++Initialize+this+with+an+array+of+pointers+to+the+%0A+++functions+declared+above.+*/%0Aint+(*my_function_pointers%5B%5D)(int)+%3D+%7Bmy_function1,+my_function2%7D%3B%0A%0Aint+main(void)+%7B%0A++/*+Invoke+the+first+function+in+the+global+function%0A+++++pointer+array.+*/%0A++return+my_function_pointers%5B0%5D(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.*/%0Aint+my_function1(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.*/%0Aint+my_function2(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-x+c+--std%3Dc99'),l:'5',n:'0',o:'%231+with+x86-64+clang+(trunk)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| example
code | https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAKxAEZTUAHAvVAOwGdK0BbRvADaYA8mwDCCAIZtgmEAHIADPICUpDqgCuxZHPkB6AFQBqACKZkAycUzHJxgGaa2yFu2MEpBD5IDWmDg8Ad1Q7YmBNHkw2Ai4AUkUAQWMUlLiAJnTkSQEBACNJZF8M9LtjRlQ8GMxiD1D7Jxc3Ng8vH39A9kwE5NS%2B/tSAN0r0csrq2usIqJi7NlGbAm1OYx6B9dTpYyqCTFliADo1vpLNDhrGa0keErLhvFGKnZqew30eneMeAE8AfUbXKw2BBPhBDNlcgUiioIPdRoY1MY4cZDGcLlceCo4gBmABCPR6RjMFisNjKEPyhV8jmcgPcnkk3gIfgCxi6SJGY2exGOYWm0W80gWmCWxBWW2e%2BwOKPeSU%2BP1%2ByDy/1pzVhnNR52Il2I1yxeIJctmPEkVXVDxUqwA7PikikiWIbIzbBLqvskdY8JI8kJHCRWrYKVDfNK3sd5X8dddVtjTMZFDjbYljkSAJJsYb%2BAM0ppA0jlSQcDhVYDbFr2J4TOoB3kpINUnN08vzbOSmp8yIC0Oy3qLZZfP4AtUKpUq3PsfMZABsCqjmMTBKtpkNiSJ5gcVRdjearUZxnQqFZbFQnhLxjymm8VUztk8gZylKKpF5lyLZ8I2YpNQAtIxiKhBgeTBRimTsYm7D5jUHVUgRBWYwXraFzXhRFkU1dFdXnJI4htY4%2BzFYxEN8CA0W1DF9STHDl2wpI10wDc2C3IjtyBXdvHwlY70Ih8fz/ACgPQXlQJmAgIKNbwR2VIdYLQ0i5yxbDcLtMtvEMHY5xjOM4NUlQ5IxBdlLwBxjAgMAwHU8jrSTPoOOMb9aAM3oqLwkV%2Bz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FhBwQot4FLEAU9hYeepZRG0DaYCkb7uNIOz7EBGRToY4Gzuw7ykqE%2ByfF6PzAnGE4cLUBCdmxnEIfGBL1tCxiKCAIF5PhG5ilhnLKm%2BxiSbYtCyXhwSupuHJSqpwHZDqeoGtpoEKXp7psL4RljAhSHwYhyEZGqmDoa2hT1nMZHIL4RZnjhcn5MiCC2E%2Bmqwg4b7HtExCoGGeBYCkPrxIk9HOnpylcs6aW/M54k6byioXCVcT2Y5IKoR5GHeYefkBURwU6YEUgCPCcLNniYzxYlyUUeV6VlplPLZSxbDStx8p8gVAZ8cBxVpcY%2BjGIZgrOU5bk1Z5hY%2BQIjWBe4LWWQUcWMAlSUpT1BJpQkZY1HUWjeNI2w8BgeDofWpwcKNcqKW6CAetNQ1zWJE5LXylUufBmSqKQAgKP%2B8ikGwCi0CjqAKGIqRSkCeNdoOuhpFKfwY6QBAKMonykL4ID/ooCMKAALCjaNKJjCgo1wjOUxzahwLASC8PwQhkBQEAi4IZYoFYMiPAQxAeqQ6EGmWXAQG0VMo7wJIEKIAgNNrpD4DYJQFlwHPkIuiP8wwzClJbAC0ezqcYTtOxwBDoGuyAAJx%2B/DtvI6jxtY/IuNk49njGHsAAcABsTsJ8z6ly0cECKx6Kgo3z1NqHTDNM/IrOh1b4fcyAvPazTttSmzYdcxTNdqAWxAcKUIDM0AA%3D%3D%3D |
| but
try not to cast functions | https://web.archive.org/web/20160425131024/http://www.mindtribe.com:80/2015/06/do-c-callbacks-like-this-not-like-that/ |
| example
code | https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaPECAKxAEZTUAHAvVAOwGdK0BbRvADaYA8mwDCCAIZtgmEAHIADPICUpDqgCuxZHPkBSAEwBmPG2QDNWANT7jYjgXQC8AIwB0CO9n2KAgr5%2BAPQAVNYAIpgWksSY1pLWvIwxeBps1gBmmuYs7NYEUgTWqYmofJIsrkLWAO6EXv7WTQCOGsQEYPIc1pgAHoxRBJjo1hx4wGwV2pju1g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options:(compileOnChange:'0'),source:'/*+Use+typedef+to+declare+the+name+%22my_function_ptr_t%22%0A+++as+an+alias+whose+type+is+a+pointer+to+a+function+that%0A+++takes+one+integer+argument+and+returns+an+integer+*/%0Atypedef+int+(*my_function_ptr_t)(int)%3B%0A%0A/*+Declare+a+simple+function+that+takes+one+integer%0A+++argument+and+returns+an+integer.+*/%0Aint+my_function(int+foo)%3B%0A%0Aint+main(void)+%7B%0A++/*+Define+a+function+pointer+variable+and+point+it+to%0A+++++the+function.+*/%0A++my_function_ptr_t+my_function_pointer+%3D+my_function%3B%0A++%0A++/*+Invoke+the+function+via+the+function+pointer.+*/%0A++return+my_function_pointer(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.*/%0Aint+my_function(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-x+c+--std%3Dc99'),l:'5',n:'0',o:'%231+with+x86-64+clang+(trunk)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| example
code | https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(j:1,options:(compileOnChange:'0'),source:'/*+Use+typedef+to+declare+the+name+%22my_function_t%22%0A+++as+an+alias+whose+type+is+a+function+that+takes%0A+++one+integer+argument+and+returns+an+integer+*/%0Atypedef+int+my_function_t(int)%3B%0A%0A/*+Declare+a+simple+function+that+takes+one+integer%0A+++argument+and+returns+an+integer.+Here+we+use+the%0A+++typedef+instead+of+typing+out+the+entire+signature.%0A+++This+may+look+a+bit+odd+to+some+developers.+Someone%0A+++more+used+to+function+pointer+typedefs+might+mistake%0A+++it+as+the+definition+of+a+function+pointer+variable.%0A+++So+I!'m+not+sure+I!'d+recommend+it.+But,+as+shown+%0A+++below,+it!'s+possible.+*/%0Astatic+my_function_t+my_function%3B%0A%0Aint+main(void)+%7B%0A++/*+Define+a+function+pointer+variable+and+point+it+to%0A+++++the+function.+*/%0A++my_function_t+*my_function_pointer+%3D+my_function%3B%0A++%0A++/*+Invoke+the+function+via+the+function+pointer.+*/%0A++return+my_function_pointer(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.+*/%0Astatic+int+my_function(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'1',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,filters:(b:'0',commentOnly:'0',directives:'0',intel:'0'),options:'-x+c+--std%3Dc99'),l:'5',n:'0',o:'%231+with+x86-64+clang+(trunk)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| std::function | https://en.cppreference.com/w/cpp/utility/functional/function |
| std::bind | https://en.cppreference.com/w/cpp/utility/functional/bind |
| example
code | https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,selection:(endColumn:12,endLineNumber:2,positionColumn:12,positionLineNumber:2,selectionStartColumn:12,selectionStartLineNumber:2,startColumn:12,startLineNumber:2),source:'/*+Use+using+to+declare+the+name+%22my_function_ptr_t%22%0A+++as+an+alias+whose+type+is+a+pointer+to+a+function+that%0A+++takes+one+integer+argument+and+returns+an+integer+*/%0Ausing+my_function_ptr_t+%3D+int+(*)(int)%3B%0A%0A/*+Declare+a+simple+function+that+takes+one+integer%0A+++argument+and+returns+an+integer.+*/%0Aint+my_function(int+foo)%3B%0A%0Aint+main(void)+%7B%0A++/*+Define+a+function+pointer+variable+and+point+it+to%0A+++++the+function.+*/%0A++my_function_ptr_t+my_function_pointer+%3D+my_function%3B%0A++%0A++/*+Invoke+the+function+via+the+function+pointer.+*/%0A++return+my_function_pointer(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.*/%0Aint+my_function(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,deviceViewOpen:'1',filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,libs:!(),options:'--std%3Dc%2B%2B11',selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+x86-64+clang+(trunk)+(Editor+%231)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| example
code | https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(filename:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,selection:(endColumn:20,endLineNumber:11,positionColumn:20,positionLineNumber:11,selectionStartColumn:20,selectionStartLineNumber:11,startColumn:20,startLineNumber:11),source:'/*+Use+using+to+declare+the+name+%22my_function_t%22%0A+++as+an+alias+whose+type+is+a+function+that+takes%0A+++one+integer+argument+and+returns+an+integer+*/%0Ausing+my_function_t+%3D+int(int)%3B%0A%0A/*+Declare+a+simple+function+that+takes+one+integer%0A+++argument+and+returns+an+integer.+Here+we+use+the%0A+++type+alias+instead+of+typing+out+the+entire+signature.%0A+++This+may+look+a+bit+odd+to+some+developers.+Someone%0A+++more+used+to+function+pointer+typedefs+might+mistake%0A+++it+as+the+definition+of+a+function+pointer+variable.%0A+++So+I!'m+not+sure+I!'d+recommend+it.+But,+as+shown+%0A+++below,+it!'s+possible.+*/%0Astatic+my_function_t+my_function%3B%0A%0Aint+main(void)+%7B%0A++/*+Define+a+function+pointer+variable+and+point+it+to%0A+++++the+function.+*/%0A++my_function_t+*my_function_pointer+%3D+my_function%3B%0A++%0A++/*+Invoke+the+function+via+the+function+pointer.+*/%0A++return+my_function_pointer(0)%3B%0A%7D%0A%0A/*+Define+the+simple+%22my_function%22+function.+*/%0Astatic+int+my_function(int+foo)+%7B%0A++return+foo%3B%0A%7D%0A'),l:'5',n:'0',o:'C%2B%2B+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:clang_trunk,deviceViewOpen:'1',filters:(b:'0',binary:'1',binaryObject:'1',commentOnly:'0',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1'),flagsViewOpen:'1',fontScale:14,fontUsePx:'0',j:1,lang:c%2B%2B,libs:!(),options:'--std%3Dc%2B%2B11',selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'+x86-64+clang+(trunk)+(Editor+%231)',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 |
| This | https://goshdarnfunctionpointers.com |
| Jerry Ryle | https://jerryryle.com |
| Block Syntax | http://goshdarnblocksyntax.com |
| Make it better! Send me a pull request! | https://github.com/jerryryle/goshdarnfunctionpointers.com |