Path: utzoo!mnetor!uunet!husc6!mailrus!nrl-cmf!cmcl2!brl-adm!adm!MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU From: MAILER%ALASKA.BITNET@CUNYVM.CUNY.EDU Newsgroups: comp.lang.c Subject: Undelivered mail Message-ID: <12300@brl-adm.ARPA> Date: 12 Mar 88 11:58:15 GMT Sender: news@brl-adm.ARPA Lines: 34 Subject: Re: Don't use Scanf() [Non-Deliverable: User does not exist or has never logged on] Reply-To: Info-C@BRL.ARPA Received: From UWAVM(MAILER) by ALASKA with Jnet id 7456 for SXJVK@ALASKA; Sat, 12 Mar 88 02:39 AST Received: by UWAVM (Mailer X1.25) id 5085; Sat, 12 Mar 88 03:39:04 PST Date: Fri, 11 Mar 88 23:06:14 GMT Reply-To: Info-C@BRL.ARPA Sender: Info-C List From: mike knudsen Subject: Re: Don't use Scanf() Comments: To: info-c@BRL-SMOKE.arpa To: Vic Kapella Good points. But if you already are using printf() in your program (with a legitimate need for the formatting) in several places, then substituting puts() where possible will make your program object file bigger, not smaller, since now the puts() code has to be linked in too. Puts() and putchar() will be a little faster, but when you're talking to humans who cares? BTW, I once wrote a large interactive monitor for a free-standing 8086 board, using a C that had no I/O at all. I wrote routines to output %2x, %4x, and %5d as well as strings. Took a lot of calls to do one good printf(), but it IS possible and such custom I/O may save you bytes. -- Mike J Knudsen ...ihnp4!ihwpt!knudsen Bell Labs(AT&T) Delphi: RAGTIMER CIS: "Just say NO to MS-DOS!" "OS/2 == 1/2 of an OS"