Path: utzoo!mnetor!uunet!husc6!bbn!rochester!rutgers!bellcore!faline!ulysses!allegra!alice!ark From: ark@alice.UUCP Newsgroups: comp.lang.c Subject: Re: question about format strings Message-ID: <7563@alice.UUCP> Date: 23 Dec 87 15:50:39 GMT References: <10954@brl-adm.ARPA> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 12 In article <10954@brl-adm.ARPA>, PEPRBV%CFAAMP.BITNET@husc6.harvard.EDU writes: > Reading the description of the format string for printf, it seemed > to me that "%10 " might be the equivalent of 10X in Fortran, that > is, insert 10 spaces. "%10 " is an illegal format string. A blank space is a format modifier, like 'l', that says that you want printf to write a space in place of a sign when the number is zero or positive. However, it has to have something to modify. So, for instance "%g" will print 3 as "3" and -3 as "-3", but "% g" will print 3 as " 3" and -3 as "-3".