Mercurial > hg > octave-lyh
diff doc/interpreter/io.txi @ 6670:14992092ab06
[project @ 2007-05-29 17:51:37 by jwe]
author | jwe |
---|---|
date | Tue, 29 May 2007 17:51:37 +0000 |
parents | 5d4ce539004f |
children | 083721ae3dfa |
line wrap: on
line diff
--- a/doc/interpreter/io.txi +++ b/doc/interpreter/io.txi @@ -352,20 +352,20 @@ formatted and written to the output stream. For example, @cindex conversion specifications (@code{printf}) -@smallexample +@example pct = 37; filename = "foo.txt"; printf ("Processing of `%s' is %d%% finished.\nPlease be patient.\n", filename, pct); -@end smallexample +@end example @noindent produces output like -@smallexample +@example Processing of `foo.txt' is 37% finished. Please be patient. -@end smallexample +@end example This example shows the use of the @samp{%d} conversion to specify that a scalar argument should be printed in decimal notation, the @samp{%s} @@ -441,9 +441,9 @@ The conversion specifications in a @code{printf} template string have the general form: -@smallexample +@example % @var{flags} @var{width} @r{[} . @var{precision} @r{]} @var{type} @var{conversion} -@end smallexample +@end example For example, in the conversion specifier @samp{%-10.8ld}, the @samp{-} is a flag, @samp{10} specifies the field width, the precision is @@ -690,9 +690,9 @@ other flags are defined, and no precision or type modifier can be given. For example: -@smallexample +@example printf ("%c%c%c%c%c", "h", "e", "l", "l", "o"); -@end smallexample +@end example @noindent prints @samp{hello}. @@ -705,9 +705,9 @@ left-justification in the field, but no other flags or type modifiers are defined for this conversion. For example: -@smallexample +@example printf ("%3s%-6s", "no", "where"); -@end smallexample +@end example @noindent prints @samp{ nowhere } (note the leading and trailing spaces). @@ -770,9 +770,9 @@ The conversion specifications in a @code{scanf} template string have the general form: -@smallexample +@example % @var{flags} @var{width} @var{type} @var{conversion} -@end smallexample +@end example In more detail, an input conversion specification consists of an initial @samp{%} character followed in sequence by: @@ -909,9 +909,9 @@ For example, reading the input: -@smallexample +@example hello, world -@end smallexample +@end example @noindent with the conversion @samp{%10c} produces @code{" hello, wo"}, but