Thread: passing a function pointer

  1. #16
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    woops! Ain't thinking clear, sorry for that!
    But thanks again, both of you!
    Currently research OpenGL

  2. #17
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    http://codepad.org/opw4HeWp

    Now, I'd like suggestions on this and is there anyway to check if a pointer, like the used pFrameFunc pointer, has been assigned anything else than 'garbage' ? Like, if it has been assigned by the code, and not some default compiler thing...

    And for the suggestions, I mean would this be the right place for the loop? I don't want the users of this engine to make the loop themselves...
    And I use the variable "bool& failed" as the condition for the loop, there is no problem with this? I mean, it is a pointer... Just to make me more sure about this!
    Thanks in advance!
    Currently research OpenGL

  3. #18
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Now, I'd like suggestions on this and is there anyway to check if a pointer, like the used pFrameFunc pointer, has been assigned anything else than 'garbage' ? Like, if it has been assigned by the code, and not some default compiler thing...
    Like any other pointer you should set it to NULL initially, since NULL checks are the only way to make sure if the pointer points to something.

    And for the suggestions, I mean would this be the right place for the loop? I don't want the users of this engine to make the loop themselves...
    And I use the variable "bool& failed" as the condition for the loop, there is no problem with this? I mean, it is a pointer... Just to make me more sure about this!
    Thanks in advance!
    I don't see why you'd want an infinite loop there.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sorting number
    By Leslie in forum C Programming
    Replies: 8
    Last Post: 05-20-2009, 04:23 AM
  2. Replies: 9
    Last Post: 12-25-2007, 05:01 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. Passing a function pointer to a templated type
    By skorman00 in forum C++ Programming
    Replies: 2
    Last Post: 04-13-2004, 08:31 PM