🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1132

Re: How to override a previously defined function??

#1132
From: David Worenklein
Date: Mon, 31 Jul 1995 18:14
35 lines
1504 bytes
Lewis Hyatt (hyatt@aimnet.com) wrote:
: In article <3um3di$48c@nyheter.chalmers.se>,
:    d0berg@dtek.chalmers.se (Lars-Ake Berg) wrote:
: >Hi boys & girls!
: >Could some wizard out there tell me how to override a function that's 
: >previously defined? For example, I would like to create a new cprintf(), 
: >but that function is already defined in CONIO.H Is this possible in C??
: >
: >Please mail me, since I seldom read this group.
: >d0berg@dtek.chalmers.se
: >
: >	/Lars-Ake Berg
: >
: >

: 	The easiest way is just to not include <conio.h>, and then the 
: compiler will never know about the original cprintf().  However if you need 
: access to other functions in conio.h, then edit conio.h and remove the line 
: that decalares cprintf.

Better yet,

#include <conio.h>

#ifdef cprintf
#undef cprintf
#endif

#define cprintf MYcprintf

-- 


 David C. Worenklein                                       GREENWICH   CAPITAL
 Operations Support                                        M a r k e t s,  Inc
Technical Details
Message-ID: <1995Jul31.181434.3748@gcm.com>
Path: arc1-ca.pugleaf.net!gcm.com!dcw
References: <3um3di$48c@nyheter.chalmers.se> <3urdan$gic@aimnet1.aimnet.com>

Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer,comp.lang.c
Path: arc1-ca.pugleaf.net!gcm.com!dcw
From: dcw@gcm.com (David Worenklein)
Subject: Re: How to override a previously defined function??
Message-ID: <1995Jul31.181434.3748@gcm.com>
Followup-To: alt.msdos.programmer,comp.lang.c
Organization: Greenwich Capital Markets, Inc.
X-Newsreader: TIN [version 1.2 PL2]
References: <3um3di$48c@nyheter.chalmers.se> <3urdan$gic@aimnet1.aimnet.com>
Date: Mon, 31 Jul 1995 18:14:34 GMT