From owner-man-jp@jp.freebsd.org  Sun May  6 15:46:23 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id PAA80056;
	Sun, 6 May 2001 15:46:23 +0900 (JST)
	(envelope-from owner-man-jp@jp.FreeBSD.org)
Received: from tortoise.jp.freebsd.org (root@tortoise.jp.FreeBSD.ORG [210.157.158.41])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id PAA80051
	for <man-jp@jp.freebsd.org>; Sun, 6 May 2001 15:46:21 +0900 (JST)
	(envelope-from yohta@mistral.imasy.or.jp)
Received: from mistral.imasy.or.jp (root@[3ffe:505:2020:1:9862:d6f:50d0:dd32])
	by tortoise.jp.freebsd.org (8.11.3+3.4W/8.11.3) with ESMTP/inet6 id f466kCb20864
	for <man-jp@jp.freebsd.org>; Sun, 6 May 2001 15:46:13 +0900 (JST)
	(envelope-from yohta@mistral.imasy.or.jp)
Received: (from yohta@localhost)
	by mistral.imasy.or.jp (8.11.3/8.11.3/mistral) id f466jf400663;
	Sun, 6 May 2001 15:45:42 +0900 (JST)
	(envelope-from yohta)
From: mistral@imasy.or.jp (Yoshihiko SARUMARU)
To: man-jp@jp.freebsd.org
In-Reply-To: Your message of "Sat, 05 May 2001 22:19:18 -0700".
	<66949.989126358@c9795-a.vncvr1.wa.home.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-2022-JP
X-Mailer: mnews [version 1.22PL5] 2001-02/07(Wed)
Date: Sun, 6 May 2001 15:45:41 +0900
Message-ID: <010506154541.M0100570@mistral.imasy.or.jp>
Reply-To: man-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: man-jp 3480
Subject: [man-jp 3480] =?ISO-2022-JP?B?GyRCS11MdToyGyhC?= (Re: 
	=?ISO-2022-JP?B?GyRCOm42SD1nGyhC?= (Re: man3
	=?ISO-2022-JP?B?GyRCOm42SDBGGyhC?= ))
Errors-To: owner-man-jp@jp.freebsd.org
Sender: owner-man-jp@jp.freebsd.org
X-Originator: mistral@imasy.or.jp

$B!!1n4]$G$9!#(B

2001-05-06($BF|(B) 14:19:18.$B:"!"(Bkumagai@home.com$B$5$s$O=q$-$^$7$?!#(B

> $B<B$O!"?HA,$r@Z$C$F!VK]Lu:2!W$rGc$C$F<j85$K$"$j$^$9!#(B
> $B$G!"$3$l$C$F(B 4.3-RELEASE $B$H$+$G$bF0$-$^$9(B?

  RELEASE $B$G$O$I$&$+$o$+$j$^$;$s$,!"(B4.3-RC, 4.3-STABLE $B$G$OF0$$(B
$B$F$^$9(B :-) static link $B$5$l$F$^$9$7!#(B

  $B$?$@I8=`$G$D$$$F$/$k(B Emacs Lisp $B$O(B Emacs 19.x $B%Y!<%9$N(B Mule $B$G(B
$B$J$$$HF0$+$J$$$G$9!#(Bxhonyaku $B$H$+(B ports $B$N(B tkhonyaku $B$H$+$K$O$=(B
$B$&$$$&@)8B$OEvA3$J$$$G$9$,!#(B
  $B$?$@$3$l$i$O(B interactive $B$JA`:n$rA0Ds$H$7$F$$$k$N$G!"%P%C%AE*(B
$B$K(B man $B$N%U%!%$%k$r=hM}$5$;$k$K$O$I$&$9$l$P$$$$$N$+!"(Bno idea $B$G(B
$B$9!#;32<$5$s$,(B elf.5$B$r$d$C$?$H$-$O<j:n6H$G$d$j$^$7$?!)(B

  $B%W%m%H%3%k$OJ8=q2=$5$l$F$$$k$N$G!"D>@\%5!<%P$H$7$c$Y$C$F@07A$9(B
$B$k$+!"(BEmacs Lisp $B$G(B loop $B$rAH$s$G$,$s$,$s2s$9$+$7$J$$$H$a$s$I$/(B
$B$5$$$J$!!"$H;W$C$F$^$9!#Lu$K$b$=$l$J$j$K;~4V$,$+$+$k$N$G!"$R$H$D(B
$B$R$H$D$d$C$F$$$/$H7k9=;~4V$,$+$+$j$^$9!#$^$!$=$l$G$b%D!<%k$r:n$C(B
$B$F$+$i$O$8$a$k$h$j$OAa$$$+$b$7$l$^$;$s$1$I(B :-)


  $B$H$j$"$($:%5%s%W%k$H$7$F@07A:Q(B printf.3 $B$rJQ49$7$F$_$^$7$?!#(B
  $B%O%$%U%M!<%7%g%s$NG'<1$OL5M}$C$]$$$G$9$M!#%O%$%U%M!<%7%g%s$,5/(B
$B$3$i$J$$$h$&$K(B roff $B$r=hM}$9$k$K$O$I$&$9$l$P$$$$$s$G$7$g$&!#$H$j(B
$B$"$($:=PNO$7$F!"8e$G$J$s$i$+$NJ8;zNs=hM}$r9T$C$F$/$C$D$1$k$N$,3Z!)(B

  $B%+%9%?%^%$%:$G$-$kFbMF$O0J2<$N$H$*$j$G$9!#!V$G$"$k!W$+$i!V$G$9(B
$B$^$9!W$X$NJQ990J30$O$3$l$,%G%U%)%k%H$G$9!#(B

# $B1QF|K]Lu(B
use_computer_dic_ej true                # $B%3%s%T%e!<%?@lLgMQ8l<-=q$rMxMQ(B
ej_ignore_case false                    # $BBgJ8;z>.J8;z$r6hJL(B
ej_preserve_input_order false           # $B8l=g$OIaDL$NF|K\8l(B
ej_imperative_by_declarative false      # $BL?Na7A$rJ?=vJ8$H$7$F07$o$J$$(B
ej_use_polite_expression true           # $B!V$G$"$k!WD4$GLu$9(B
ej_connect_katakana_by_point true       # $B%+%?%+%J8l$r!V!&!W$G$D$J$0(B


[$B1Q(B] PRINTF(3)
[$BF|(B] PRINTF(3)

[$B1Q(B] FreeBSD Library Functions Manual
[$BF|(B] FreeBSD Library Functions Manual

[$B1Q(B] PRINTF(3)
[$BF|(B] PRINTF(3)

[$B1Q(B] NAME
[$BF|(B] NAME

[$B1Q(B] printf, fprintf, sprintf, snprintf, asprintf, vprintf, vfprintf, vsprintf, vsnprintf, vasprintf - formatted output conversion
[$BF|(B] printf$B!"(Bfprintf$B!"(Bsprintf$B!"(Bsnprintf$B!"(Basprintf$B!"(Bvprintf$B!"(Bvfprintf$B!"(Bvsprintf$B!"(Bvsnprintf$B!J(Bvasprintf$B!K!J%U%)!<%^%C%HIU$-=PNOJQ49!K(B

[$B1Q(B] LIBRARY
[$BF|(B] LIBRARY

[$B1Q(B] Standard C Library (libc, -lc)
[$BF|(B] $B5,3J(BC$B?^=q4[!J(Blibc$B$K(B-lc$B!K(B

[$B1Q(B] SYNOPSIS
[$BF|(B] SYNOPSIS

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdio.h>
[$BF|(B] <stdio.h>$B$r4^$a$F$/$@$5$$(B

[$B1Q(B] int printf(const char *format, ...)
[$BF|(B] int printf(const$B$O!"(B*format$B!"(B..$B$r$3$,$7$^$9!#!K(B

[$B1Q(B] int fprintf(FILE *stream, const char *format, ...)
[$BF|(B] int fprintf(FILE *stream$B$O!"(Bconst$B$K(B*format$B!"(B..$B$r$3$,$7$^$9!#!K(B

[$B1Q(B] int sprintf(char *str, const char *format, ...)
[$BF|(B] int sprintf(char *str$B$O!"(Bconst$B$K(B*format$B!"(B..$B$r$3$,$7$^$9!#!K(B

[$B1Q(B] int snprintf(char *str, size_t size, const char *format, ...)
[$BF|(B] int snprintf(char *str$B!J(Bsize_t$B%5%$%:!K$O!"(Bconst$B$K(B*format$B!"(B..$B$r$3$,$7$^$9!#!K(B

[$B1Q(B] int asprintf(char **ret, const char *format, ...)
[$BF|(B] int asprintf(char **ret$B$O!"(Bconst$B$K(B*format$B!"(B..$B$r$3$,$7$^$9!#!K(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdarg.h>
[$BF|(B] <stdarg.h>$B$r4^$a$F$/$@$5$$(B

[$B1Q(B] int vprintf(const char *format, va_list ap)
[$BF|(B] int vprintf(const$B$O!"(B*format$B!J(Bva_list ap$B!K$r$3$,$7$^$9!K(B

[$B1Q(B] int vfprintf(FILE *stream, const char *format, va_list ap)
[$BF|(B] int vfprintf(FILE *stream$B!"(Bconst char *format$B!"(Bva_list ap$B!K(B

[$B1Q(B] int vsprintf(char *str, const char *format, va_list ap)
[$BF|(B] int vsprintf(char *str$B!"(Bconst char *format$B!"(Bva_list ap$B!K(B

[$B1Q(B] int vsnprintf(char *str, size_t size, const char *format, va_list ap)
[$BF|(B] int vsnprintf(char *str$B!"(Bsize_t$B%5%$%:!"(Bconst char *format$B!"(Bva_list ap$B!K(B

[$B1Q(B] int vasprintf(char **ret, const char *format, va_list ap)
[$BF|(B] int vasprintf(char **ret$B!"(Bconst char *format$B!"(Bva_list ap$B!K(B

[$B1Q(B] DESCRIPTION
[$BF|(B] DESCRIPTION

[$B1Q(B] The printf() family of functions produces output according to a format as described below.
[$BF|(B] $B5!G=$N(Bprintf()$B%U%!%_%j!<$O!"2<5-$N$h$&$K%U%)!<%^%C%H$K$h$C$F=PNO$r@8;:$7$^$9!#(B

[$B1Q(B] Printf() and vprintf() write output to stdout, the standard output stream;
[$BF|(B] Printf()$B$H(Bvprintf()$B$O!"(Bstdout$B!JI8=`$N=PNO%9%H%j!<%`!K$K=PNO$r=q$-$^$9!((B

[$B1Q(B] fprintf() and vfprintf() write output to the given output stream;
[$BF|(B] fprintf()$B$H(Bvfprintf()$B$O!"M?$($i$l$?=PNO%9%H%j!<%`$K=PNO$r=q$-$^$9!((B

[$B1Q(B] sprintf(), snprintf(), vsprintf(), and vsnprintf() write to the character string str;
[$BF|(B] sprintf()$B!"(Bsnprintf()$B!"(Bvsprintf()$B$H(Bvsnprintf()$B$O!"J8;zNs(Bstr$B$K=q$-9~$_$^$9!((B

[$B1Q(B] and asprintf() and vasprintf() dynamically allocate a new string with malloc(3).
[$BF|(B] $B$=$7$F!"(Basprintf()$B$H(Bvasprintf()$B$O!"(Bmalloc(3)$B$GF0E*$K?7$7$$J8;zNs$r3d$jEv$F$^$9!#(B

[$B1Q(B] These functions write the output under the control of a format string that specifies how subsequent arguments (or arguments accessed via the variable-length argument facilities of stdarg(3)) are converted for output.
[$BF|(B] $B$3$l$i$N5!G=$O!"$I$&0J9_$N0z?t!J$^$?$O(Bstdarg(3)$B$N2DJQD90z?t5!G=$rDL$7$F%"%/%;%9$5$l$k0z?t!K$,=PNO$N$?$a$KJQ49$5$l$k$+$K$D$$$F;XDj$9$k%U%)!<%^%C%HJ8;zNs$N@)8f$N2<$G!"=PNO$r=q$-$^$9!#(B

[$B1Q(B] These functions return the number of characters printed (not including the trailing `\0' used to end output to strings).
[$BF|(B] $B$3$l$i$N5!G=$O!"0u:~$5$l$k!J!X(B0$B1_!Y$,J8;zNs$K%(%s%I%"%&%H%W%C%H$K;H$C$?8eCV$r4^$^$J$$$3$H!KJ8;z$N%J%s%P!<$rJV$7$^$9!#(B

[$B1Q(B] Asprintf() and vasprintf() set *ret to be a pointer to a buffer sufficiently large to hold the formatted string.
[$BF|(B] Asprintf()$B$H(Bvasprintf()$B$O!"==J,$K%U%)!<%^%C%H$5$l$?J8;zNs$r;}$D$?$a$KBg$-$$%P%C%U%!$X$N%]%$%s%?!<$G$"$k(B*ret$B$r%;%C%H$7$^$7$?!#(B

[$B1Q(B] This pointer should be passed to free(3) to release the allocated storage when it is no longer needed.
[$BF|(B] $B$=$l$,$b$O$dI,MW$G$J$$$H$-!"$3$N%]%$%s%?!<$O3d$jEv$F$i$l$?5-21$r%j%j!<%9$9$k$?$a$K(Bfree(3)$B$KDL2a$5$l$J$1$l$P$J$j$^$;$s!#(B

[$B1Q(B] If sufficient space cannot be allocated, asprintf() and vasprintf() will return -1 and set ret to be a NULL pointer.
[$BF|(B] $B==J,$J%9%Z!<%9$,3d$jEv$F$i$l$k$3$H$,$G$-$J$$$J$i$P!"(Basprintf()$B$H(Bvasprintf()$B$O(B-1$B$rI|5"$7$F!"6u%]%$%s%?!<$G$"$k?;?e$r%;%C%H$7$^$9!#(B

[$B1Q(B] Snprintf() and vsnprintf() will write at most size-1 of the characters printed into the output string (the size'th character then gets the terminating `\0');
[$BF|(B] Snprintf()$B$H(Bvsnprintf()$B$O!"=PNOJ8;zNs!J(Bsize'th$BJ8;z$O!"$=$l$+$i!X(B0$B1_!Y$r=*N;$9$k$3$H$rF@$^$9!K$K:G$bB?$/$N0u:~$5$l$kJ8;z$N(Bsize-1$B$G=q$-9~$_$^$9!((B

[$B1Q(B] if the return value is greater than or equal to the size argument, the string was too short and some of the printed characters were discarded.
[$BF|(B] $BLa$jCM$,%5%$%:0z?t0J>e$J$i$P!"J8;zNs$O$"$^$j$KC;$+$C$?$G$9!"$=$7$F!"0u:~$5$l$?J8;z$N0lIt$O<N$F$i$l$^$7$?!#(B

[$B1Q(B] Sprintf() and vsprintf() effectively assume an infinite size.
[$BF|(B] Sprintf()$B$H(Bvsprintf()$B$O!"8z2LE*$KL58B$N%5%$%:$r2>Dj$7$^$9!#(B

[$B1Q(B] The format string is composed of zero or more directives:
[$BF|(B] $B%U%)!<%^%C%HJ8;zNs$O!">/$J$/$H$b(B0$B;X<(8l$G9=@.$5$l$^$9!'(B

[$B1Q(B] ordinary characters (not %), which are copied unchanged to the output stream;
[$BF|(B] $BIaDL$NJ8;z!J(B%$B$G$J$$!K!"%3%T!<$5$l$^$9=PNO%9%H%j!<%`$KITJQ$N!((B

[$B1Q(B] and conversion specifications, each of which results in fetching zero or more subsequent arguments.
[$BF|(B] $B$=$7$F!"JQ49;EMM!J$I$A$i$,>/$J$/$H$b(B0$B0J9_$N0z?t$r%U%'%C%A$9$9$3$H$K=*$o$k$+3F!9!K!#(B

[$B1Q(B] Each conversion specification is introduced by the character %. The arguments must correspond properly (after type promotion) with the conversion specifier.
[$BF|(B] $B3FJQ49;EMM$OJ8;z(B%$B$K$h$C$F>R2p$5$l$^$9!#(BThe$B0z?t$O@5$7$/JQ49;XDj;R$H0lCW$7$J$1$l$P$J$j$^$;$s!J%?%$%W>:3J$N8e!K!#(B

[$B1Q(B] After the %, the following appear in sequence:
[$BF|(B] %$B$N8e!"$"$H$KB3$/$3$H$O<!!9$H8=$l$^$9!'(B

[$B1Q(B] o An optional field, consisting of a decimal digit string followed by a $, specifying the next argument to access . If this field is not provided, the argument following the last argument accessed will be used.
[$BF|(B] $$B$,B3$/(B10$B?J$N?t;zNs$+$i$J$k!"%*%W%7%g%s$N(Bo An$B$O%"%/%;%9$9$k<!$N0z?t$r;XDj$9$k$3$H$r%U%#!<%k%IJ,$1$7$^$9!#$3$N%U%#!<%k%I$,Ds6!$5$l$J$$!":G8e$N0z?t$KB3$$$F$$$k0z?t$,%"%/%;%9$7$?(BIf$B$,;H$o$l$^$9!#(B

[$B1Q(B] Arguments are numbered starting at 1.
[$BF|(B] $B0z?t$O!"(B1$B;~$K;O$^$C$F?t$($i$l$^$9!#(B

[$B1Q(B] If unaccessed arguments in the format string are interspersed with ones that are accessed the results will be indeterminate.
[$BF|(B] $B%U%)!<%^%C%HJ8;zNs$G$N(Bunaccessed$B$5$l$?0z?t$,%"%/%;%9$5$l$k$b$N$rE@:_$9$k$J$i$P!"7k2L$OIT3NDj$G$9!#(B

[$B1Q(B] o Zero or more of the following flags:
[$BF|(B] $B0J2<$N%U%i%0$N(Bo Zero$B$^$?$O$h$jB?$/!'(B

[$B1Q(B] -
[$BF|(B] $B!](B

[$B1Q(B] A # character specifying that the value should be converted to an ``alternate form''.
[$BF|(B] $BCM$,!VBeBX$N%U%)!<%`!W$KJQ49$5$l$J$1$l$P$J$i$J$$$3$H$r<($7$F$$$k(B#$BJ8;z!#(B

[$B1Q(B] For c, d, i, n, p, s, and u, conversions, this option has no effect.
[$BF|(B] c$B!"(Bd$B!"(Bi$B!"(Bn$B!"(Bp$B!"(Bs$B$H(Bu$B!JJQ49!K$N$?$a$K$3$N%*%W%7%g%s$K$O!"1F6A$,$"$j$^$;$s!#(B

[$B1Q(B] For o conversions, the precision of the number is increased to force the first character of the output string to a zero (except if a zero value is printed with an explicit precision of zero).
[$BF|(B] o$BJQ49$N$?$a$K!"%J%s%P!<$N@:EY$O!"%<%m!J(B0$BCM$,%<%m$NL@3N$J@:EY$G0u:~$5$l$k$+$I$&$+$r=|$$$F!K$K!"=PNOJ8;zNs$N:G=i$NJ8;z$r6/@)$9$k$?$a$KA}$d$5$l$^$9!#(B

[$B1Q(B] For x and X conversions, a non-zero result has the string `0x' (or `0X' for X conversions) prepended to it.
[$BF|(B] x$B$H(BX$BJQ49$N$?$a$K!"%<%m0J30$N7k2L$O!"$=$l$K%W%j%Z%s%I$5$l$kJ8;zNs!X(B0x$B!Y!J$^$?$O(BX$BJQ49$N$?$a$N!X(B0X$B!Y!K$r;}$A$^$9!#(B

[$B1Q(B] For e, E, f, g, and G, conversions, the result will always contain a decimal point, even if no digits follow it (normally, a decimal point appears in the results of those conversions only if a digit follows).
[$BF|(B] e$B!"(BE$B!"(Bf$B!"(Bg$B$H(BG$B!JJQ49!K$N$?$a$K$?$H$(7e$,$=$l!JDL>o!"7e$,$"$H$KB3$/>l9g$@$1!">.?tE@$O$=$l$i$NJQ49$N7k2L$K8=$l$^$9!K$KB3$+$J$$$H$7$F$b!"7k2L$O>o$K>.?tE@$r4^$_$^$9!#(B

[$B1Q(B] For g and G conversions, trailing zeros are not removed from the result as they would otherwise be.
[$BF|(B] g$B$H(BG$BJQ49$N$?$a$K!"H`$i$,0lJ}$$$k$@$m$&$N$G!"8eCV%<%m$O7k2L$+$i:o=|$5$l$^$;$s!#(B

[$B1Q(B] -
[$BF|(B] $B!](B

[$B1Q(B] A zero `0' character specifying zero padding.
[$BF|(B] $B%<%m!&%Q%G%#%s%0$r;XDj$7$F$$$k(B0$B!X(B0$B!Y$NJ8;z!#(B

[$B1Q(B] For all conversions except n, the converted value is padded on the left with zeros rather than blanks.
[$BF|(B] n$B0J30$NA4$F$NJQ49$N$?$a$K!"JQ49$5$l$?CM$O!"%V%i%s%/$h$j$`$7$m%<%m$G:8$G5M$aJ*$r$5$l$^$9!#(B

[$B1Q(B] If a precision is given with a numeric conversion (d, i, o, u, i, x, and X), the `0' flag is ignored.
[$BF|(B] $B@:EY$,%K%e!<%a%j%C%/$NJQ49!J(Bd$B!"(Bi$B!"(Bo$B!"(Bu$B!"(Bi$B!"(Bx$B$H(BX$B!K$GM?$($i$l$k$J$i$P!"!X(B0$B!Y$N%U%i%0$OL5;k$5$l$^$9!#(B

[$B1Q(B] -
[$BF|(B] $B!](B

[$B1Q(B] A negative field width flag `-' indicates the converted value is to be left adjusted on the field boundary.
[$BF|(B] $BH]Dj$N%U%#!<%k%I$NI}%U%i%0!X!]!Y!"JQ49$5$l$?CM$,%U%#!<%k%I6-3&$N>e$GD4@a$5$l$F$*$+$l$k$3$H$K$J$C$F$$$k$3$H$r<($7$^$9!#(B

[$B1Q(B] Except for n conversions, the converted value is padded on the right with blanks, rather than on the left with blanks or zeros.
[$BF|(B] n$BJQ49$r=|$$$F!"JQ49$5$l$?CM$O!"%V%i%s%/$^$?$O%<%m$K$h$k:8$N>e$N%V%i%s%/$G8"Mx$G5M$aJ*$r$5$l$^$9!#(B

[$B1Q(B] A `-' overrides a `0' if both are given.
[$BF|(B] $B!X!]!Y!"N>J}$H$bM?$($i$l$k!X(B0$B!Y$N$b$7$b$r1[$($^$9!#(B

[$B1Q(B] -
[$BF|(B] $B!](B

[$B1Q(B] A space, specifying that a blank should be left before a positive number produced by a signed conversion (d, e, E, f, g, G, or i).
[$BF|(B] $B%V%i%s%/$,=pL>$5$l$?JQ49!J(Bd$B!"(Be$B!"(BE$B!"(Bf$B!"(Bg$B!"(BG$B$^$?$O;d!K$K$h$C$F@8;:$5$l$k@5$N?t$NA0$K;D$5$l$J$1$l$P$J$i$J$$$3$H$r<($7$F!"%9%Z!<%9!#(B

[$B1Q(B] -
[$BF|(B] $B!](B

[$B1Q(B] A `+' character specifying that a sign always be placed before a number produced by a signed conversion.
[$BF|(B] $BId9f$,>o$K=pL>$5$l$?JQ49$K$h$C$F@8;:$5$l$k%J%s%P!<$NA0$KCV$+$l$k$h$&$K;XDj$7$F$$$k!X(B+$B!YJ8;z!#(B

[$B1Q(B] A `+' overrides a space if both are used.
[$BF|(B] $BN>J}$H$b;H$o$l$k$J$i$P!"!X(B+$B!Y$O%9%Z!<%9$r1[$($^$9!#(B

[$B1Q(B] o An optional decimal digit string specifying a minimum field width.
[$BF|(B] $B:G>.%U%#!<%k%I$NI}$r;XDj$7$F$$$k(Bo An$B%*%W%7%g%s$N(B10$B?J$N?t;zNs!#(B

[$B1Q(B] If the converted value has fewer characters than the field width, it will be padded with spaces on the left (or right, if the left-adjustment flag has been given) to fill out the field width.
[$BF|(B] $BJQ49$5$l$?CM$,%U%#!<%k%I$NI}$h$j>/$7$NJ8;z$r;}$D$J$i$P!"$=$l$O%U%#!<%k%I$NI}$K5-F~$9$k$?$a$K:8!J$^$?$O@5$7$$:8$ND4@0%U%i%0$,M?$($i$l$?$J$i$P!K$G!"%9%Z!<%9$r5M$a$i$l$^$9!#(B

[$B1Q(B] o An optional precision, in the form of a period `.' followed by an optional digit string.
[$BF|(B] o An$B%*%W%7%g%s$N@:EY!"4|4V$N7A$G!X!#!Y%*%W%7%g%s$N?t;zNs$K$h$C$F$"$H$KB3$-$^$9!#(B

[$B1Q(B] If the digit string is omitted, the precision is taken as zero.
[$BF|(B] $B?t;zNs$,>JN,$5$l$k$J$i$P!"@:EY$O%<%m$H$7$F$H$i$l$^$9!#(B

[$B1Q(B] This gives the minimum number of digits to appear for d, i, o, u, x, and X conversions, the number of digits to appear after the decimal-point for e, E, and f conversions, the maximum number of significant digits for g and G conversions, or the maximum number of characters to be printed from a string for s conversions.
[$BF|(B] $B$3$l$O!"(Bd$B!"(Bi$B!"(Bo$B!"(Bu$B!"(Bx$B$H(BX$B$N$?$a$KJQ49!"(Be$B$N$?$a$K>.?tE@$N8e!"8=$l$k7e?t!"(BE$B$H(Bf$B$N$h$&$K8+$($k$?$a$K:G>.7e?t$KJQ49!"(Bg$B$H(BG$BJQ49$N$?$a$NM-8z?t;z$N:GBg?t$^$?$O(Bs$BJQ49$N$?$a$KJ8;zNs$+$i0u:~$5$l$kJ8;z$N:GBg?t$rM?$($^$9!#(B

[$B1Q(B] o The optional character h, specifying that a following d, i, o, u, x, or X conversion corresponds to a short int or unsigned short int argument, or that a following n conversion corresponds to a pointer to a short int argument.
[$BF|(B] $B0J2<$N(Bd$B!"(Bi$B!"(Bo$B!"(Bu$B!"(Bx$B$^$?$O(BX$BJQ49$,C;$$(Bint$B$^$?$O%5%$%s$,$J$$C;$$(Bint$B0z?t$H0lCW$9$k!"$"$k$$$O!"0J2<$N(Bn$BJQ49$,C;$$(Bint$B0z?t$K%]%$%s%?!<$H0lCW$9$k$3$H$r<($7$F!"(Bo The$B%*%W%7%g%s$NJ8;z(Bh$B!#(B

[$B1Q(B] o The optional character l (ell) specifying that a following d, i, o, u, x, or X conversion applies to a pointer to a long int or unsigned long int argument, or that a following n conversion corresponds to a pointer to a long int argument.
[$BF|(B] $B0J2<$N(Bd$B!"(Bi$B!"(Bo$B!"(Bu$B!"(Bx$B$^$?$O(BX$BJQ49$,D9$$(Bint$B$^$?$O%5%$%s$,$J$$D9$$(Bint$B0z?t$K%]%$%s%?!<$K$"$F$O$^$k!"$"$k$$$O!"0J2<$N(Bn$BJQ49$,D9$$(Bint$B0z?t$K%]%$%s%?!<$H0lCW$9$k$3$H$r<($7$F$$$k(Bo The$B%*%W%7%g%s$NJ8;z(Bl$B!J%(%k!K!#(B

[$B1Q(B] o The optional character q, specifying that a following d, i, o, u, x, or X conversion corresponds to a quad int or unsigned quad int argument, or that a following n conversion corresponds to a pointer to a quad int argument.
[$BF|(B] $B0J2<$N(Bd$B!"(Bi$B!"(Bo$B!"(Bu$B!"(Bx$B$^$?$O(BX$BJQ49$,%+%C%I(Bint$B$^$?$O%5%$%s$,$J$$;MG\$N9-$5$N(Bint$B0z?t$H0lCW$9$k!"$"$k$$$O!"0J2<$N(Bn$BJQ49$,;MG\$N9-$5$N(Bint$B0z?t$K%]%$%s%?!<$H0lCW$9$k$3$H$r<($7$F!"(Bo The$B%*%W%7%g%s$NJ8;z(Bq$B!#(B

[$B1Q(B] o The character L specifying that a following e, E, f, g, or G conversion corresponds to a long double argument.
[$BF|(B] $B0J2<$N(Be$B!"(BE$B!"(Bf$B!"(Bg$B$^$?$O(BG$BJQ49$,D9$$G\$N0z?t$H0lCW$9$k$3$H$r<($7$F$$$k(Bo The$BJ8;z(BL$B!#(B

[$B1Q(B] o A character that specifies the type of conversion to be applied.
[$BF|(B] $BE,MQ$5$l$kJQ49$N%?%$%W$r;XDj$9$k(Bo A$BJ8;z!#(B

[$B1Q(B] A field width or precision, or both, may be indicated by an asterisk `*' or an asterisk followed by one or more decimal digits and a `$' instead of a digit string.
[$BF|(B] $B%U%#!<%k%I$NI}$^$?$O@:EYN>J}$H$b!"$"$k$$$O!B?t;zNs$NBe$o$j$K0l$D0J>e$N==?J?t;z$H!X(B$$B!Y$,B3$/%"%9%?%j%9%/!X(B*$B!Y$^$?$O%"%9%?%j%9%/$K$h$C$F<($9$+$b$7$l$^$;$s!#(B

[$B1Q(B] In this case, an int argument supplies the field width or precision.
[$BF|(B] $B$3$N>l9g!"(Bint$B0z?t$O!"%U%#!<%k%I$NI}$^$?$O@:EY$r6!5k$7$^$9!#(B

[$B1Q(B] A negative field width is treated as a left adjustment flag followed by a positive field width;
[$BF|(B] $B:8$ND4@0%U%i%0$,%]%8%F%#%V$J%U%#!<%k%I$NI}$K$h$C$F$"$H$KB3$$$?$N$G!"H]Dj$N%U%#!<%k%I$NI}$O07$o$l$^$9!((B

[$B1Q(B] a negative precision is treated as though it were missing.
[$BF|(B] $B$^$k$G$=$l$,8+$D$+$i$J$+$C$?$h$&$K!"H]Dj$N@:EY$O07$o$l$^$9!#(B

[$B1Q(B] If a single format directive mixes positional (nn$) and non-positional arguments, the results are undefined.
[$BF|(B] $B0l$D$N%U%)!<%^%C%H;X<(8l$,0LCV!J(Bnn$$B!K$GHs0LCV$N0z?t$r:.$<$k$J$i$P!"7k2L$OL$Dj5A$G$9!#(B

[$B1Q(B] The conversion specifiers and their meanings are:
[$BF|(B] $BJQ49;XDj;R$HH`$i$N0UL#$O!"0J2<$NDL$j$G$9(B

[$B1Q(B] diouxX The int (or appropriate variant) argument is converted to signed decimal (d and i), unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal (x and X) notation.
[$BF|(B] $B0z?t$,JQ49$5$l$k(BdiouxX The int$B!J$^$?$OE,Ev$JJQ2=!K$O!">.?t!J(Bd$B$H;d!K!"%5%$%s$,$J$$#8?J!J(Bo$B!K!"%5%$%s$,$J$$>.?t!J(Bu$B!K$^$?$O%5%$%s$,$J$$#1#6?J$N!J(Bx$B$H(BX$B!K5-K!$K=pL>$7$^$7$?!#(B

[$B1Q(B] The letters abcdef are used for x conversions;
[$BF|(B] $BJ8;z(Babcdef$B$,!"(Bx$BJQ49$N$?$a$K;H$o$l$^$9!((B

[$B1Q(B] the letters ABCDEF are used for X conversions.
[$BF|(B] $BJ8;z(BABCDEF$B$,!"(BX$BJQ49$N$?$a$K;H$o$l$^$9!#(B

[$B1Q(B] The precision, if any, gives the minimum number of digits that must appear;
[$BF|(B] $B@:EY$O!"$b$7$"$l$P8=$l$J$1$l$P$J$i$J$$:G>.7e?t$rM?$($^$9!((B

[$B1Q(B] if the converted value requires fewer digits, it is padded on the left with zeros.
[$BF|(B] $BJQ49$5$l$?CM$,$h$j>/$7$N7e$rI,MW$H$9$k$J$i$P!"$=$l$O%<%m$G:8$G5M$aJ*$r$5$l$^$9!#(B

[$B1Q(B] DOU
[$BF|(B] DOU

[$B1Q(B] The long int argument is converted to signed decimal, unsigned
[$BF|(B] $BD9$$(Bint$B0z?t$O!"Id9fIU$-(B10$B?J?t!J%5%$%s$,$J$$!K$KJQ49$5$l$^$9(B

[$B1Q(B] octal, or unsigned decimal, as if the format had been ld, lo, or lu respectively.
[$BF|(B] $B#8?J$^$?$O%5%$%s$,$J$$>.?t$^$k$G%U%)!<%^%C%H$,$=$l$>$l(Bld$B!"8+$h$^$?$O(Blu$B$G$"$C$?$h$&$K!#(B

[$B1Q(B] These conversion characters are deprecated, and will eventually disappear.
[$BF|(B] $B$3$l$i$NJQ49%-%c%i%/%?!<$O!"HsFq$5$l$F!"7k6I>C$($^$9!#(B

[$B1Q(B] eE
[$BF|(B] eE

[$B1Q(B] The double argument is rounded and converted in the style
[$BF|(B] $BG\$N0z?t$O!"4]$/$5$l$F!"%9%?%$%k$GJQ49$7$^$7$?(B

[$B1Q(B] [-]
[$BF|(B] [$B!](B]

[$B1Q(B] d.ddde+-dd where there is one digit before the decimal-point character and the number of digits after it is equal to the precision;
[$BF|(B] d.ddde+-dd$B!"(B1$B$D$N7e$,!">.?tE@J8;z$NA0$K$"$j$^$9!"$=$7$F!"$=$l$N8e$N7e?t$O!"@:EY$HEy$7$$$G$9!((B

[$B1Q(B] if the precision is missing, it is taken as 6;
[$BF|(B] $B@:EY$,8+$D$+$i$J$$$J$i$P!"$=$l$O(B6$B$H$7$F$H$i$l$^$9!((B

[$B1Q(B] if the precision is zero, no decimal-point character appears.
[$BF|(B] $B@:EY$,%<%m$G$"$k$J$i$P!">.?tE@J8;z$O8=$l$^$;$s!#(B

[$B1Q(B] An E conversion uses the letter E (rather than e) to introduce the exponent.
[$BF|(B] E$BJQ49$O!"J8;z(BE$B$r;H$$$^$9!J(Be$B!K;X?t$r>R2p$7$^$9!#(B

[$B1Q(B] The exponent always contains at least two digits;
[$BF|(B] $B;X?t$O!">o$K>/$J$/$H$b(B2$B$D$N7e$r4^$_$^$9!((B

[$B1Q(B] if the value is zero, the exponent is 00.
[$BF|(B] $BCM$,%<%m$G$"$k$J$i$P!";X?t$O(B00$B$G$9!#(B

[$B1Q(B] f
[$BF|(B] f

[$B1Q(B] The double argument is rounded and converted to decimal notation
[$BF|(B] $BG\$N0z?t$O!"4]$/$5$l$F!"==?J5-?tK!$KJQ49$7$^$7$?(B

[$B1Q(B] in the style [-]ddd.ddd, where the number of digits after the decimal-point character is equal to the precision specification.
[$BF|(B] $B%9%?%$%k$G(B[-$B>.?tE@J8;z$N8e$N7e?t$,@:EY%9%Z%C%/$HEy$7$$(B]ddd.ddd$B!#(B

[$B1Q(B] If the precision is missing, it is taken as 6;
[$BF|(B] $B@:EY$,8+$D$+$i$J$$$J$i$P!"$=$l$O(B6$B$H$7$F$H$i$l$^$9!((B

[$B1Q(B] if the precision is explicitly zero, no decimal-point character appears.
[$BF|(B] $B@:EY$,L@<(E*$K%<%m$G$"$k$J$i$P!">.?tE@J8;z$O8=$l$^$;$s!#(B

[$B1Q(B] If a decimal point appears, at least one digit appears before it.
[$BF|(B] $B>.?tE@$,8=$l$k$J$i$P!">/$J$/$H$b(B1$B$D$N7e$O$=$l$NA0$K8=$l$^$9!#(B

[$B1Q(B] gG
[$BF|(B] gG

[$B1Q(B] The double argument is converted in style f or e (or E for G con-
[$BF|(B] $BG\$N0z?t$O!"%9%?%$%k(Bf$B$^$?$O(Be$B$K$*$$$FJQ49$5$l$^$9!J$^$?$O(BG$BH?BP$N$?$a$N(BE

[$B1Q(B] versions)
[$BF|(B] $B%P!<%8%g%s!K(B

[$B1Q(B] . The precision specifies the number of significant digits.
[$BF|(B] $B!#(BThe$B@:EY$O!"M-8z?t;z$N%J%s%P!<$r;XDj$7$^$9!#(B

[$B1Q(B] If the precision is missing, 6 digits are given;
[$BF|(B] $B@:EY$,8+$D$+$i$J$$$J$i$P!"(B6$B$D$N7e$OM?$($i$l$^$9!((B

[$B1Q(B] if the precision is zero, it is treated as 1.
[$BF|(B] $B@:EY$,%<%m$G$"$k$J$i$P!"$=$l$O(B1$B$H$_$J$5$l$^$9!#(B

[$B1Q(B] Style e is used if the exponent from its conversion is less than -4 or greater than or equal to the precision.
[$BF|(B] $B$=$NJQ49$+$i$N;X?t$,(B-4$B$h$j>/$J$$$+@:EY0J>e$J$i$P!"%9%?%$%k(Be$B$,;H$o$l$^$9!#(B

[$B1Q(B] Trailing zeros are removed from the fractional part of the result;
[$BF|(B] $B8eCV%<%m$O!"7k2L$N>.?tE@It$+$i:o=|$5$l$^$9!((B

[$B1Q(B] a decimal point appears only if it is followed by at least one digit.
[$BF|(B] $B$=$l$N8e$K>/$J$/$H$b(B1$B$D$N7e$,B3$/>l9g$@$1!">.?tE@$O8=$l$^$9!#(B

[$B1Q(B] c
[$BF|(B] c

[$B1Q(B] The int argument is converted to an unsigned char, and the re-
[$BF|(B] int$B0z?t$O!"%5%$%s$,$J$$(Bchar$B$H%l$KJQ49$5$l$^$9(B

[$B1Q(B] sulting character is written.
[$BF|(B] $BJ8;z$r(Bsulting$B$9$k$3$H$O!"=q$+$l$^$9!#(B

[$B1Q(B] s
[$BF|(B] s

[$B1Q(B] The ``char *'' argument is expected to be a pointer to an array
[$BF|(B] $B!V(Bchar *$B!W0z?t$O!"G[Ns$X$N%]%$%s%?!<$G$"$k$3$H$K$J$C$F$$$^$9(B

[$B1Q(B] of character type (pointer to a string).
[$BF|(B] $B%-%c%i%/%?!<7?!JJ8;zNs$X$N%]%$%s%?!<!K$N!#(B

[$B1Q(B] Characters from the array are written up to (but not including) a terminating NUL character;
[$BF|(B] $BG[Ns$+$i$NJ8;z$O!"=*C<#N#U#LJ8;z$K=q$-$"$2$i$l$^$9!J$7$+$7!"4^$^$J$$$3$H!K!((B

[$B1Q(B] if a precision is specified, no more than the number specified are written.
[$BF|(B] $B@:EY$,;XDj$5$l$k$J$i$P!";XDj$5$l$k%J%s%P!<$h$j$3$l0J>e$O=q$+$l$^$;$s!#(B

[$B1Q(B] If a precision is given, no null character need be present;
[$BF|(B] $B@:EY$,M?$($i$l$k$J$i$P!"%L%k!&%-%c%i%/%?$OB8:_$9$kI,MW$O$"$j$^$;$s!((B

[$B1Q(B] if the precision is not specified, or is greater than the size of the array, the array must contain a terminating NUL character.
[$BF|(B] $B@:EY$,;XDj$5$l$J$$$+!"G[Ns$N%5%$%:$h$jBg$-$/$J$$$J$i$P!"G[Ns$O=*C<#N#U#LJ8;z$r4^$^$J$1$l$P$J$j$^$;$s!#(B

[$B1Q(B] p
[$BF|(B] p

[$B1Q(B] The ``void *'' pointer argument is printed in hexadecimal (as if
[$BF|(B] $B!V%\%$%I(B*$B!W%]%$%s%?!<0z?t$O!"#1#6?J$G0u:~$5$l$^$9!J$b$7$b$H$7$F(B

[$B1Q(B] by `%#x' or `%#lx').
[$BF|(B] $B!X(B%#x$B!Y$^$?$O!X(B%#lx$B!Y$K$h$C$F!K!#(B

[$B1Q(B] n
[$BF|(B] n

[$B1Q(B] The number of characters written so far is stored into the inte-
[$BF|(B] $B$3$l$^$G=q$+$l$kJ8;z$N%J%s%P!<$O!"(Binte-$B$K3JG<$5$l$^$9(B

[$B1Q(B] ger indicated by the ``int *'' (or variant) pointer argument.
[$BF|(B] $B%2%k$O!"!V(Bint *$B!W!J$^$?$O0[$J$k!K$K$h$C$F!"%]%$%s%?!<0z?t$r<($7$^$7$?!#(B

[$B1Q(B] No argument is converted.
[$BF|(B] $B0z?t$O!"JQ49$5$l$^$;$s!#(B

[$B1Q(B] %
[$BF|(B] %

[$B1Q(B] A `%' is written.
[$BF|(B] 1$B!X(B%$B!Y$O!"=q$+$l$^$9!#(B

[$B1Q(B] No argument is converted.
[$BF|(B] $B0z?t$O!"JQ49$5$l$^$;$s!#(B

[$B1Q(B] The complete conversion specification is `%%'.
[$BF|(B] $B40A4$JJQ49;EMM$O!"!X(B%%$B!Y$G$9!#(B

[$B1Q(B] In no case does a non-existent or small field width cause truncation of a field;
[$BF|(B] $B7h$7$F!"B8:_$7$J$$$+>.$5$$%U%#!<%k%I$NI}$O!"%U%#!<%k%I$N@Z<N$F$r0z$-5/$3$7$^$;$s!((B

[$B1Q(B] if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result.
[$BF|(B] $BJQ49$N7k2L$,%U%#!<%k%I$NI}$h$j9-$$$J$i$P!"%U%#!<%k%I$OJQ497k2L$r4^$`$?$a$K9-$2$i$l$^$9!#(B

[$B1Q(B] EXAMPLES
[$BF|(B] EXAMPLES

[$B1Q(B] To print a date and time in the form `Sunday, July 3, 10:02', where weekday and month are pointers to strings:
[$BF|(B] $B%U%)!<%`!X(B10:02$B!"(B7$B7n(B3$BF|F|MKF|!Y!J=5F|$H7n$,J8;zNs$X$N%]%$%s%?!<$G$"$k$H$3$m!K$G!"F|IU$1$H;~4V$r0u:~$7$^$9!'(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdio.h> fprintf(stdout, "%s, %s %d, %.2d:%.2d\n", weekday, month, day, hour, min);
[$BF|(B] <stdio.h> fprintf(stdout$B$r4^$_$^$9!"!V(B%s$B!"(B%s %d$B!"(B%.2d$B!'(B%.2d\n$B!W!J=5F|!K7n!"F|!";~4V!":G>.CM!K!((B

[$B1Q(B] To print pi to five decimal places:
[$BF|(B] 5$B$D$N>.?t0L$K%Q%$$r0u:~$7$^$9!'(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <math.h>
[$BF|(B] <math.h>$B$r4^$a$F$/$@$5$$(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdio.h> fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0));
[$BF|(B] <stdio.h> fprintf(stdout$B!"!V%Q%$(B= %.5f\n$B!W!"(B4$B$D$N(B* atan(1.0)$B$r4^$_$^$9!K!((B

[$B1Q(B] To allocate a 128 byte string and print into it:
[$BF|(B] $B$=$l$K(B128$B$N%P%$%HJ8;zNs$H%W%j%s%H$r3d$jEv$F$^$9!'(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdio.h>
[$BF|(B] <stdio.h>$B$r4^$a$F$/$@$5$$(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdlib.h>
[$BF|(B] <stdlib.h>$B$r4^$a$F$/$@$5$$(B

[$B1Q(B] #
[$BF|(B] #

[$B1Q(B] include <stdarg.h> char *newfmt(const char *fmt, ...)
[$BF|(B] <stdarg.h> char *newfmt(const char *fmt$B!"(B..$B$r4^$a$F$/$@$5$$!#!K(B

[$B1Q(B] {
[$BF|(B] $B!P(B

[$B1Q(B] char *p;
[$BF|(B] *p$B$r$3$,$7$^$9!((B

[$B1Q(B] va_list ap;
[$BF|(B] va_list ap$B!((B

[$B1Q(B] if ((p = malloc(128)) == NULL) return (NULL);
[$BF|(B] $B!J!J(Bp = malloc(128)$B!K(B==$B6uGr!K%j%?!<%s!J6uGr!K$J$i$P!((B

[$B1Q(B] va_start(ap, fmt);
[$BF|(B] va_start(ap$B!"(Bfmt$B!K!((B

[$B1Q(B] (void)
[$BF|(B] $B!J%\%$%I!K(B

[$B1Q(B] vsnprintf(p, 128, fmt, ap);
[$BF|(B] vsnprintf(p$B!"(B128$B!"(Bfmt$B!"(Bap$B!K!((B

[$B1Q(B] va_end(ap);
[$BF|(B] va_end(ap)$B!((B

[$B1Q(B] return (p);
[$BF|(B] $BI|5"$7$^$9!J(Bp$B!K!((B

[$B1Q(B] }
[$BF|(B] $B!Q(B

[$B1Q(B] SEE ALSO
[$BF|(B] SEE ALSO

[$B1Q(B] printf(1), scanf(3)
[$BF|(B] printf(1)$B!J(Bscanf(3)$B!K(B

[$B1Q(B] STANDARDS
[$BF|(B] STANDARDS

[$B1Q(B] The fprintf(), printf(), sprintf(), vprintf(), vfprintf(), and vsprintf() functions conform to ISO/IEC 9899:1990 (``ISO C89'').
[$BF|(B] fprintf()$B!"(Bprintf()$B!"(Bsprintf()$B!"(Bvprintf()$B!"(Bvfprintf()$B$H(Bvsprintf()$B5!G=$O!"(BISO/IEC 9899$B!'(B1990$B!J!V(BISO C89$B!W!K$K=>$$$^$9!#(B

[$B1Q(B] HISTORY
[$BF|(B] HISTORY

[$B1Q(B] The functions asprintf() and vasprintf() first appeared in the GNU C library.
[$BF|(B] $B5!G=(Basprintf()$B$H(Bvasprintf()$B$O!":G=i$K(BGNU C$B%i%$%V%i%j!<$K8=$l$^$7$?!#(B

[$B1Q(B] These were implemented by Peter Wemm <peter@FreeBSD.org> in FreeBSD 2.2, but were later replaced with a different implementation from Todd C. Miller <Todd.Miller@courtesan.com> for OpenBSD 2.3.
[$BF|(B] $B$3$l$i$O!"(BFreeBSD 2.2$B$G$N%T!<%?!<(BWemm <peter@FreeBSD.org>$B$K$h$C$F<B9T$5$l$k$,!"(BOpenBSD 2.3$B$N$?$a$K8e$G%H%C%I(BC.$B%_%i!<(B<Todd.Miller@courtesan.com>$B$H0[$J$k%$%s%W%j%a%s%F!<%7%g%s$H<h$jBX$($i$l$^$7$?!#(B

[$B1Q(B] BUGS
[$BF|(B] BUGS

[$B1Q(B] The conversion formats %D, %O, and %U are not standard and are provided only for backward compatibility.
[$BF|(B] $BJQ49%U%)!<%^%C%H(B%D$B!"(B%O$B$H(B%U$B$O!"I8=`$G$J$/$F!"2<0L8_49@-$@$1$KBP$7$FMQ0U$5$l$F$$$^$9!#(B

[$B1Q(B] The effect of padding the %p format with zeros (either by the `0' flag or by specifying a precision), and the benign effect (i.e., none) of the `#' flag on %n and %p conversions, as well as other nonsensical combinations such as %Ld, are not standard;
[$BF|(B] %p$B%U%)!<%^%C%H$K%<%m!J!X(B0$B!Y$N%U%i%0$K$h$k$^$?$O@:EY$r;XDj$9$k$3$H$K$h$k$I$A$i$G$b!K$r5M$a$k1F6A$H(B%n$B$H(B%p$BJQ49!J(B%Ld$B$N$h$&$JB>$NL50UL#$J7k9g$HF1MM$K!K$N!X(B#$B!Y%U%i%0$NM%$7$$1F6A!J$9$J$o$A!"2?$b!K$O!"I8=`$G$O$"$j$^$;$s!((B

[$B1Q(B] such combinations should be avoided.
[$BF|(B] $B$=$N$h$&$J7k9g$O!"Hr$1$i$l$J$1$l$P$J$j$^$;$s!#(B

[$B1Q(B] Because sprintf() and vsprintf() assume an infinitely long string, callers must be careful not to overflow the actual space;
[$BF|(B] sprintf()$B$H(Bvsprintf()$B$,L58B$KD9$$J8;zNs$r2>Dj$9$k$N$G!"H/?.<T$O<B:]$N%9%Z!<%9$+$i$"$U$l=P$J$$$h$&$KCm0U$7$J$1$l$P$J$j$^$;$s!((B

[$B1Q(B] this is often hard to assure.
[$BF|(B] $B$3$l$O!"$?$S$?$SJ]>Z$9$k$N$,Fq$7$$$G$9!#(B

[$B1Q(B] For safety, programmers should use the snprintf() interface instead.
[$BF|(B] $B0BA4$N$?$a$K!"%W%m%0%i%^$O$=$NBe$o$j$K(Bsnprintf()$B%$%s%?%U%'!<%9$r;H$o$J$1$l$P$J$j$^$;$s!#(B

[$B1Q(B] Unfortunately, this interface is not portable.
[$BF|(B] $B;DG0$J$3$H$K!"$3$N%$%s%?%U%'!<%9$O!"0\F0<0$G$O$"$j$^$;$s!#(B

[$B1Q(B] BSD
[$BF|(B] BSD

[$B1Q(B] June 4, 1993
[$BF|(B] 1993$BG/(B6$B7n(B4$BF|(B

[$B1Q(B] 5
[$BF|(B] 5


> $B$3$A$i$GK]Lu:2F0$+$7$F$b9=$$$^$;$s!#$G!"$d$^$7$?$5$s1n4]$5$s$K$*4j$$$7(B
> $B$?$$$N$O!";d$,!V%^%j%"MM$K$*4j$$!W$rFI$s$G$k4V$K(B 4.3-RELEASE / 4.3-RC2 
> $B$H$+$GF0:n$9$k$+$I$&$+$r3NG'$7$H$$$F$b$i$($?$i$"$j$,$?$$$G$9!#(B

  $B%"%l$H$O;w$FHs$J$k$b$N$J$s$G$7$g$&$+!D!D!#(B


  $B8D?ME*$K$O=c?h$KLu$K$+$+$k;~4V$h$j$b%=!<%9$r8+$?$j!"<B:]$KF0$+(B
$B$7$F$_$?$j!"B>$N4XO"%^%K%e%"%k$H8l$rB7$($?$j!"$h$jE,@Z$JLu8l$r5a(B
$B$a$F<-=q$r0z$-D>$7$F$_$?$j!"$H$$$&;~4V$NJ}$,B?$$$N$G!":n6H$N8zN((B
$B%"%C%W$K7R$,$k$+$I$&$+$OITL@$G$9!#<+J,$G0UL#$N<h$l$J$$J8$OK]Lu:2(B
$B$bLLGr$$Lu$rG1$j=P$7$F$/$l$^$9$7!#(B
$B!!CN$i$J$$C18l$,O"H/$5$l$F$$$k>l9g$K!"$H$j$"$($:J80U$rA[A|$9$k$K(B
$B$OLrN)$D$+$b!#(B

--
$B1n4]K'I'(B (Yoshihiko SARUMARU)
mail: mistral@imasy.or.jp       web: http://www.imasy.or.jp/~mistral/
