Xref: utzoo comp.sources.games.bugs:890 comp.lang.c:19850 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!puff!kschnitz From: kschnitz@puff.UUCP (Soccer Stud) Newsgroups: comp.sources.games.bugs,comp.lang.c Subject: vsprintf undefined Keywords: vsprintf varargs Message-ID: <3171@puff.UUCP> Date: 11 Jul 89 19:55:40 GMT Organization: Gould CSD, Fort Lauderdale, FL Lines: 42 Help! This function came with the tetris game I got for Unix based machines. The problem is vsprintf is undefined using my C libraries. Does anyone have a simple solution? Please post the answer because others have had the same problem. Thanks in advance. /***************************************************************************\ |* *| |* This is my home-made varargs-based version of C++'s neat function of *| |* the same name. It saves all that tedious mucking about with static *| |* buffers which you sprintf into, then forget all about, by basically *| |* being a sprintf with its own statis storage. It takes as arguments *| |* exactly the same things as printf(3), and returns a pointer to the *| |* resultant string. *| |* *| \***************************************************************************/ /*VARARGS*/ char *form (va_alist) va_dcl { va_list pvar; char *fmt_string; static char result[LINELEN]; va_start (pvar); fmt_string = va_arg (pvar, char*); (void) vsprintf (result, fmt_string, pvar); va_end (pvar); return (result); } -- Kevin Schnitzius (Encore Computer Corporation, Ft. Lauderdale, Florida) (formerly Gould CSD) ********************* Please ignore the From: line ************************ Uucp: {pur-ee,sun,codas!novavax,uunet,mcnc!rti,etc}!gould!kschnitizius Internet: temporarily disconnected What a bunch of typing, huh?