Jun 16, 2025
Оfftopic Community
Оfftopic Community
Forums
New posts
Search forums
What's new
Featured content
New posts
New media
New media comments
New resources
New profile posts
Latest activity
Media
New media
New comments
Search media
Resources
Latest reviews
Search resources
Members
Current visitors
New profile posts
Search profile posts
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
OffTopic Community
Introductions
Newbie Function Question.?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JoelKatz" data-source="post: 2549729" data-attributes="member: 232450"><p>int operation (int x, int y, int (*functocall)(int,int))</p><p>This means that 'operation' is a function that returns an integer (that's the 'int operation (' part). It takes as parameters two integers, called 'x' and 'y' (that's the 'int x, int y' part), and a pointer to a function called 'functocall' which returns an integer and takes two integers (that's the 'int (*functocall)(int,int)' part).</p><p></p><p>int (*minus)(int,int) = subtraction;</p><p>This creates a pointer called 'minus' (that's the '*minus' part). It points to a function takes two integers as parameters and returns one (that's the 'int' and '(int,int)' parts). The pointer initially points to the function named 'subtraction' (that's the '=subtraction' part).</p><p></p><p>Hope that helps.</p></blockquote><p></p>
[QUOTE="JoelKatz, post: 2549729, member: 232450"] int operation (int x, int y, int (*functocall)(int,int)) This means that 'operation' is a function that returns an integer (that's the 'int operation (' part). It takes as parameters two integers, called 'x' and 'y' (that's the 'int x, int y' part), and a pointer to a function called 'functocall' which returns an integer and takes two integers (that's the 'int (*functocall)(int,int)' part). int (*minus)(int,int) = subtraction; This creates a pointer called 'minus' (that's the '*minus' part). It points to a function takes two integers as parameters and returns one (that's the 'int' and '(int,int)' parts). The pointer initially points to the function named 'subtraction' (that's the '=subtraction' part). Hope that helps. [/QUOTE]
Insert quotes…
Name
Verification
Please enable JavaScript to continue.
Loading…
Post reply
Top