Generated with CERN WebMaker
The % Character
To output a percent character (%) using any of the formatted output procedures, use two adjacent percent characters, %% in the format string.
call printf ("Ratio: %f%%\n")
call pargr (ratio)
Results in:
Ratio: 12.34%
(assuming the value of ratio is 12.34). Buffered Output
Standard formatted output is normally buffered. The result is that output to STDOUT may not appear on the user's terminal right away. The buffer is flushed when it is full, at the end of the task, or when it is explicitly flushed. The buffer may be flushed with flush(), whose argument is the file descriptor of the stream, STDOUT for example. In some cases, particularly in deing stages of development, it may be desirable to have output appear more quickly. Rather than using flush() repeatedly, you may set the fio parameter F_FLUSHNL to YES with a call to fset(). This advises fio to flush the buffer whenever it prints a newline character. Thus, output will appear on every line. Output to STDERR always flushes on newlines.