Thread: passing functions as parameters?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    269

    passing functions as parameters?

    I'm new to C and am working on this project. In there, there's these lines of code...

    Code:
    static int
    smpl_handler(manager man, void *virt_event, void *c_data, att_list attrs)
    {
        simple_rec_ptr loc_event = virt_event;
       printing stuff
    }
    then in main, they have this..

    Code:
    term_action(man, stn_ev, format_list, smpl_handler);
    term_action is a function and they're passing in the other function? smpl_handler has parameters but those aren't passed.. I'm confused as to what's going on here

    also smpl_handler is defined as "static int"... but it's a function that doesn't return any values....
    Last edited by dayalsoap; 08-27-2010 at 12:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 04:25 AM
  2. Passing parameters between templated functions
    By SpaceCadet in forum C++ Programming
    Replies: 1
    Last Post: 11-20-2006, 03:57 PM
  3. Passing pointers between functions
    By heygirls_uk in forum C Programming
    Replies: 5
    Last Post: 01-09-2004, 06:58 PM
  4. Replies: 1
    Last Post: 02-06-2003, 03:33 PM
  5. functions passing parameters
    By volk in forum C Programming
    Replies: 9
    Last Post: 01-02-2003, 05:49 PM