Date: Tue, 5 Dec 2000 07:40:04 -0800 (PST) From: Mark Huizer <xaa@timewasters.nl> To: freebsd-doc@freebsd.org Subject: Re: docs/20117: *printf manpage doesn't document %n Message-ID: <200012051540.eB5Fe4p87214@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR docs/20117; it has been noted by GNATS.
From: Mark Huizer <xaa@timewasters.nl>
To: "Jason M. Taylor" <jtaylor@precisioncs.net>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012051540.eB5Fe4p87214>
