|
-
Function pointers???
Hello everyone. I am having some trouble using function pointers in C/C++. I am building an AI engine for my game, and what I am trying to do is this: lets say I have a function called process. It would take an integer as one argument. The function would then compare it to 0. Then, if it is greater, it would call another function called die(); But what I want to be able to do is pass in any function as an argument(instead of die(); I wanted to pass in live() , to Process, and have Process call the function. I know this must somehow be possible with function pointers, but I never really dealt with them much before, and I'm a bit shaky. Any help would be appreciated. Thanks, SHEEP
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|