Re: not calling function at run time ..

Discussion in 'C Programming' started by Wictory, Jun 24, 2003.

  1. Wictory

    Wictory Guest

    On Tue, 24 Jun 2003 21:10:47 +0530
    Paras Sharma <> wrote:

    > Hi ,
    >
    > I have one Library function DBG() - a kind wrapper kindof function
    > for printf. ( it takes variable number of parameters )
    >
    > DBG( stringname, index, " Hello %d %s ..", i,c);
    > DBG( stringname, index, " Hello %d %c %i %s ..", i,c1, j, c);
    > .......
    >
    >
    > I am using DBG at many places in the code . Now Just for testing I want
    > not to call this function at run time.
    > How to do it without commenting 10000s of places ..
    >
    > Is there any other like using some hashdefine #define DBG(ABC..)
    > or some other way.
    >
    >
    > Thanks in advance .
    > Paras
    >


    You can comment every call to the function (as you mentioned above)
    or you can subtitute the function DBG() with a dummy function like:

    /*
    The real DBG() function:

    DBG()
    {

    your function code;

    }

    */
    /* Here is a sample dummy function: */

    DBG()
    {

    return 0;

    }

    -- Wictory
     
    Wictory, Jun 24, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paras Sharma

    not calling function at run time ..

    Paras Sharma, Jun 24, 2003, in forum: C++
    Replies:
    1
    Views:
    836
    Victor Bazarov
    Jun 24, 2003
  2. Mark A. Odell

    Re: not calling function at run time ..

    Mark A. Odell, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    1,176
    Mark A. Odell
    Jun 24, 2003
  3. Derk Gwen

    Re: not calling function at run time ..

    Derk Gwen, Jun 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    779
    Derk Gwen
    Jun 24, 2003
  4. Pierre Yves
    Replies:
    2
    Views:
    503
    Pierre Yves
    Jan 10, 2008
  5. Replies:
    3
    Views:
    2,023
    Steven D'Aprano
    Jul 25, 2009
Loading...

Share This Page