From owner-freebsd-doc Tue Dec 5 7:40: 7 2000 From owner-freebsd-doc@FreeBSD.ORG Tue Dec 5 07:40:05 2000 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0590037B400 for ; Tue, 5 Dec 2000 07:40:05 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eB5Fe4p87214; Tue, 5 Dec 2000 07:40:04 -0800 (PST) (envelope-from gnats) Date: Tue, 5 Dec 2000 07:40:04 -0800 (PST) Message-Id: <200012051540.eB5Fe4p87214@freefall.freebsd.org> To: freebsd-doc@freebsd.org Cc: From: Mark Huizer Subject: Re: docs/20117: *printf manpage doesn't document %n Reply-To: Mark Huizer Sender: gnats@FreeBSD.org Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR docs/20117; it has been noted by GNATS. From: Mark Huizer To: "Jason M. Taylor" Cc: freebsd-gnats-submit@FreeBSD.org, xaa@dohd.org Subject: Re: docs/20117: *printf manpage doesn't document %n Date: Tue, 5 Dec 2000 16:30:08 +0100 The wise Jason M. Taylor produced the following lines: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > After some looking, I found this documentation from the GNU libc > manual. Would this be acceptable? > > The `%n' conversion is unlike any of the other output conversions. > It uses an argument which must be a pointer to an `int', but > instead of > printing anything it stores the number of characters printed so > far by > this call at that location. The `h' and `l' type modifiers are > permitted to specify that the argument is of type `short int *' > or > `long int *' instead of `int *', but no flags, field width, or > precision are permitted. > > For example, > > int nchar; > printf ("%d %s%n\n", 3, "bears", &nchar); > > prints: > > 3 bears > > and sets `nchar' to `7', because `3 bears' is seven characters > Fine with me, as long as something is in the man pages :-) Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message