Xref: utzoo comp.sys.m6809:698 comp.lang.c:7686 Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!ihnp4!ihwpt!knudsen From: knudsen@ihwpt.ATT.COM (mike knudsen) Newsgroups: comp.sys.m6809,comp.lang.c Subject: Don't use Scanf() Keywords: C stdio library Message-ID: <2401@ihwpt.ATT.COM> Date: 29 Feb 88 19:55:23 GMT Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 23 Don't use Scanf() from the C Standard Library if you care about the size of your object program. It uses 5K (yes, 5000 bytes) of text space, plus over 200 bytes of Data. Ripping it out of my huge music editor really opened things up for new features this weekend. [Above figures are for Microware OS9 6809 C library]. It's well worth writing your own code to do simple parses. Among the string functions, try Index(char, string) which will find commas and such in the input. Input is best got from gets(string). Besides, scanf() has always been hostile to users who don't type in just the right stuff. If you need it for user-friendly stuff use gets(string) followed by sscanf(string). Note: "string" means "(char *)" or "char[]" in the above. PS: Printf() is probably just as big, but usually harder to do without, especially in a big program. -- 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"