Storing function arguments

This is a discussion on Storing function arguments within the C++ Programming forums, part of the General Programming Boards category; I'm trying to create a sort of events function, I'll be adding actions to a list and then executing one ...

  1. #1
    C/C++ Learner & Lover
    Join Date
    Aug 2008
    Location
    Argentina
    Posts
    193

    Storing function arguments

    I'm trying to create a sort of events function, I'll be adding actions to a list and then executing one by one. My problem is that I don't really know how to store the arguments of each function. I want to function pointers and their arguments so I can execute them in a row.
    Thanks in advance.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Presumably you don't want the answer "in variables", but that's where you store things.

    (If you have function pointers, then the type of the function pointer contains within it the types of the arguments, so you will know what types to use.)

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,554
    How about function objects? Such as boost::bind.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    C/C++ Learner & Lover
    Join Date
    Aug 2008
    Location
    Argentina
    Posts
    193
    The boost library seems really nice, I'll take a look at it, thanks!

  5. #5
    Or working on it anyways mramazing's Avatar
    Join Date
    Dec 2005
    Location
    Lehi, UT
    Posts
    121
    A stack perhaps?
    -- Will you show me how to c++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Help passing arguments to function
    By HAssan in forum C Programming
    Replies: 2
    Last Post: 11-26-2007, 01:15 PM
  4. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM

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