⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 printf.3

📁 UNIX v6源代码 这几乎是最经典的unix版本 unix操作系统设计和莱昂氏unix源代码分析都是用的该版
💻 3
字号:
.th PRINTF III 9/17/73.sh NAMEprintf \*- formatted print.sh SYNOPSIS.ft Bprintf(format, arg\s6\d1\u\s10, ...);.brchar *format;.ft R.sh DESCRIPTION.it Printfconverts, formats, and prints its arguments after the firstunder control of the first argument.The first argument is a character stringwhich containstwo types of objects:plain characters, which are simply copied to theoutput stream,and conversion specifications,each of which causes conversion and printingof the next successive argument to.it printf..s3Each conversion specification is introduced bythe character \fB%\fR.Following the \fB%\fR, there may be.s3.lp +6 2\*-	an optional minus sign ``\*-'' which specifies.it "left adjustment"of the converted argumentin theindicated field;.s3.lp +6 2\*-	an optional digit string specifying a.it "field width;"if the converted argument has fewer charactersthan the field widthit will be blank-padded on the left (or right,if the left-adjustment indicator has beengiven) to make up the field width;.s3.lp +6 2\*-	an optional period ``\fB.\fR'' which serves toseparate the field width from thenext digit string;.s3.lp +6 2\*-	an optional digit string.it "(precision)"which specifiesthe number of digits to appear after thedecimal point, for e- and f-conversion,or the maximum number of charactersto be printed from a string;.s3.lp +6 2\*-	a character which indicates the type ofconversion to be applied..s3.i0The conversion charactersand their meanings are.s3.lp +6 3d.lp +6 3o.lp +6 3x	The integer argument is converted to decimal, octal, orhexadecimal notation respectively..s3.lp +6 3f	The argument is converted to decimal notationin the style ``[\fB\*-\fR]ddd.ddd''where the number of d's after the decimal pointis equal to the precision specificationfor the argument.If the precisionis missing,6 digits are given;if the precision is explicitly 0, no digits andno decimal point are printed.The argument should be.it floator.it double..s3.lp +6 3e	The argument is converted in the style``[\fB\*-\fR]d\fB.\fRddd\fBe\fR\(+-dd''where there is one digit before the decimal point andthe number after is equal to theprecision specification for the argument;when the precision is missing,6 digits are produced.The argument should be a.it floator.it doublequantity..s3.lp +6 3c	The argument character is printed..s3.lp +6 3s	The argument is taken to be a string (character pointer)and characters from the string are printed untila null character or untilthe number of characters indicated by the precisionspecification is reached;however if the precision is 0 or missingall characters up to a null are printed..s3.lp +6 3l	The argument is taken to be an unsignedinteger which is converted to decimaland printed (the result will be in therange 0 to 65535)..s3.i0If no recognizable character appears after the \fB%\fR,that character is printed;thus \fb%\fR may be printed by use of thestring \fB%%\fR.In no case does a non-existent or small field widthcause truncation of a field;padding takes place only if the specified fieldwidth exceeds the actual width.Characters generated by.it printfare printed by calling.it putchar..sh "SEE ALSO"putchar (III).sh BUGSVery wide fields (>128 characters) fail.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -