delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/11/14:51:50.1

From: ams AT ludd DOT luth DOT se (Martin Str|mberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie question - want to have one function in a separate file, how do I code?
Date: 11 Jan 1999 18:18:52 GMT
Organization: University of Lulea, Sweden
Lines: 18
Message-ID: <77dfac$6d1$3@news.luth.se>
References: <369c3855 DOT 11709658 AT news>
NNTP-Posting-Host: queeg.ludd.luth.se
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Stuart Hall (fprintf AT iname DOT com) wrote:
: I have made an implementation of gets() that is a lot safer than the
: standard function - it is safer because it won't overrun an array.

You mean like the fgets() function?

: I would like to include this function in just about every program that
: I write, but I don't really want to write the function prototype and
: copy and paste the function into every program.  Is there a method for
: placing either the Object file, or the C file in a common location and
: calling for it with an #include statement?

Make a library and a header file. You include the header file, and add
-l<my_library> to the link line.

Right,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019