not calling function at run time ..

Discussion in 'C++' started by Paras Sharma, Jun 24, 2003.

  1. Paras Sharma

    Paras Sharma Guest

    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
    Paras Sharma, Jun 24, 2003
    #1
    1. Advertising

  2. "Paras Sharma" <> wrote...
    > 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.



    The crudest way is

    #define DBG while (false) DBG

    Victor
    Victor Bazarov, Jun 24, 2003
    #2
    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. Mark A. Odell

    Re: not calling function at run time ..

    Mark A. Odell, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    1,158
    Mark A. Odell
    Jun 24, 2003
  2. Wictory

    Re: not calling function at run time ..

    Wictory, Jun 24, 2003, in forum: C Programming
    Replies:
    0
    Views:
    917
    Wictory
    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:
    764
    Derk Gwen
    Jun 24, 2003
  4. Pierre Yves
    Replies:
    2
    Views:
    470
    Pierre Yves
    Jan 10, 2008
  5. Replies:
    3
    Views:
    1,978
    Steven D'Aprano
    Jul 25, 2009
Loading...

Share This Page