Thread: Pass function to function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2020
    Posts
    31

    Pass function to function

    Compile hangs up at calc_run_time1 call for calc_vap_abv.
    Error message is: 'argument' undeclared (first use in this function).

    Full code is lengthy so these are pertinent snippets.
    The pointer types are arrays, except for the calc_vap_abv function. The calc_vap_abv function solves the array elements that the calc_runtime1 function then uses.

    Can you tell from snippets what I am doing wrong?
    Thx



    Definitions
    Code:
    double calc_vap_abv(
        int index, 
        double *pot_l_abv, 
        double *pot_v_abv, 
        double *pot_r_abv, 
        double c_riser1, 
        double c_riser2, 
        double init_reflux)
    Code:
    double calc_run_time1(
        int index, 
        double *pot_l_vol, 
        double *pot_l_abv, 
        double *thp_l_vol, 
        double *thp_l_abv, 
        double *pot_r_abv,                   
        double p_kw1, 
        double riser_time, 
        double c_riser1,
        double *runtime, 
        double pot_abv_dec,
        double (*calc_vap_abv)(int index, double *pot_l_abv, double *pot_v_abv, 
                      double *pot_r_abv, double c_riser1, double c_riser2, double init_reflux))
    runtime call
    Code:
     calc_run_time1(
        index, 
        pot_l_vol, 
        pot_l_abv, 
        thp_l_vol, 
        thp_l_abv, 
        pot_r_abv, 
        p_kw1, 
        riser_time, 
        c_riser1, 
        run_time, 
        pot_abv_dec, 
        calc_vap_abv);
    calc vap abv call inside runtime function
    Code:
    calc_vap_abv(
        index, 
        pot_l_abv, 
        pot_v_abv, 
        pot_r_abv, 
        c_riser1, 
        c_riser2, 
        init_reflux);
    Last edited by Salem; 03-19-2022 at 08:47 AM. Reason: Wrapped for clarity

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2012, 07:18 AM
  2. how to pass a set to function
    By iHateSicsic in forum C++ Programming
    Replies: 1
    Last Post: 01-02-2011, 10:24 AM
  3. Replies: 3
    Last Post: 11-22-2007, 12:58 AM
  4. how to pass a function as a parmeter to a function?
    By billy_other in forum C Programming
    Replies: 2
    Last Post: 04-25-2005, 12:17 AM

Tags for this Thread