c++ - Explanation of function pointers - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

I have a problem with understanding some C++ syntax combined with function pointers and function declarations, that is:. Resultsfromthe2022DeveloperSurveyarenowavailable Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore Explanationoffunctionpointers AskQuestion Asked 6years,4monthsago Modified 4years,9monthsago Viewed 4ktimes 22 4 IhaveaproblemwithunderstandingsomeC++syntaxcombinedwithfunctionpointersandfunctiondeclarations,thatis: Usuallywhenwewanttodeclareatypeoffunctionwemakesomethinglike: typedefvoid(*functionPtr)(int); andthisisfineforme.FromnowonfunctionPtrisatype,thatrepresents pointertothefunction,thatreturnsvoidandtakesintbyavalueasanargument. Wecanuseitasfollows: typedefvoid(*functionPtr)(int); voidfunction(inta){ std::cout<



請為這篇文章評分?