The control characters for white space and the backspace control character ’\b’
(see table below) are interpreted by all output functions which write to text files and which receive such control characters, either as character constants (starting with \
) or as numerical EBCDIC values, as arguments. The decimal and hexadecimal values of the control characters can be found in the C and C++ User Guides (EBCDIC table).
Key to the following table:
X blank | The control character is converted to its appropriate effect. The control character is written to the file as a text character (EBCDIC value).
|
Tab character (\t
)
The tab character is converted to the appropriate number of spaces. Tab stops are set 8 columns apart (1, 9, 17, ...). Spaces are also substituted for the tab character on input.
In the case of SAM and ISAM files, the tab character is expanded to spaces by default only in the KERNIGHAN-RITCHIE
compilation mode, not in the ANSI mode (see also fopen()
and freopen()
).
Line feed (\n
)
The newline character is converted to a change of line (change of record). Subsequent read functions will then return a newline character for a change of record.
Page feed (\f
)
SYSLST
: A page feed is executed, and subsequent data is output on a new page.SYSOUT
, SYSTERM
for writing: The message
please acknowledge
is output on the terminal.
Vertical tab (\v
)
An appropriate number of blank lines is output to reach the next line tab position. These tab positions are 8 lines apart (1, 9, 17, ...).
Carriage return (\r
)
The cursor is returned to the start of the current line without a line feed, i.e. subsequent data is written to the same line. This enables characters to be underlined, for example.
Backspace (\b
)
The next character is written to the position of the previous character. This allows a letter to be provided with an accent, for example. Strictly speaking, \b
is not a white-space character (see isspace()
) but a control character (see iscntrl()
).
The use of \r
and \b
is only meaningful for printers with overwrite capabilities.