Article View: comp.lang.c.moderated
Article #2013Re: But DO C hackers code concisely?
From: Maurice S. Barnum
Date: Fri, 16 Feb 1996 06:12
Date: Fri, 16 Feb 1996 06:12
29 lines
1708 bytes
1708 bytes
Michael Smith <msmith@mpx.com.au> writes:
>Richard A. O'Keefe wrote:
>[Snip]
>>
>> But all such comments pale into insignificance when you realise that
>> _in context_ the whole chunk can be written as
>>
>> 1. sprintf(lpReportLint->szAddress, "%06lX", lBufIndex);
>> I won't defend the coding style, but I will defend the avoidance of
>sprintf(). When you build a DLL using MS Visual C/C++, a number of
>standard library functions are not permitted - including the printf
>and scanf family. Thus, when developing Windows tools it is unwise
i'm not sure i actually believe that MS Visual C/C++ is
_that_ broken. sprintf() does not in any way assume the
existence of a console, and there is _no_ reason why a
compiler of suitable quality (or standardness) cannot
implement it. (fortunately, the Windows compiler that I use
has no problem with DLLs that call sprintf()).
wsprintf() is essentially sprintf() without floating point
support. since it's provided by the "OS" you will
presumably save a little space in your objects, but that
seems to be small gain for the loss of functionality and the
probable (marginal) peformance hit.
--xmsb
xmsb@borland.com
Technical Details
Message-ID:
<4g177l$msi@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4fa7e7$2pu@solutions.solon.com> <4fst4u$2f1@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: xmsb@shadow.borland.com (Maurice S. Barnum) Newsgroups: comp.lang.c.moderated Subject: Re: But DO C hackers code concisely? Date: 16 Feb 1996 00:12:05 -0600 Organization: Borland Intl Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4g177l$msi@solutions.solon.com> References: <4fa7e7$2pu@solutions.solon.com> <4fst4u$2f1@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com