Function pointers

This is a discussion on Function pointers within the C++ Programming forums, part of the General Programming Boards category; I have a question about the usage of function pointers in general. In my blackjack game I have alot of ...

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    964

    Function pointers

    I have a question about the usage of function pointers in general. In my blackjack game I have alot of output strings that are updated with different kinds of functions, a draw function would update my hand, a different function would update a prompt or something like that...

    I'm trying to make it so I can automatically update all my output items in one call even though they are updated in different ways. I figure I could use inheritence for nodes in a linked list to derive an update function for these differently updated output items. I could also create the nodes with a pointer to a function that updates them, would that be possible?
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    >> ...would that be possible?
    Probably.

    You can read up on what function pointers here: http://www.newty.de/fpt/index.html

    Whether or not it's the best approach to solve the problem is a different question

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 08:32 AM
  2. Problem with function pointers
    By vNvNation in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2004, 06:49 AM
  3. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 12:18 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. function pointers and member functions
    By thor in forum C++ Programming
    Replies: 5
    Last Post: 03-19-2002, 03:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21