November 1999
Intermediate to advanced
832 pages
19h 28m
English
puts stdout {Hello, World!}
=> Hello, World!
|
In this example, the command is puts, which takes two arguments: an I/O stream identifier and a string. puts writes the string to the I/O stream along with a trailing newline character. There are two points to emphasize:
Arguments are interpreted by the command. In the example, stdout is used to identify the standard output stream. The use of stdout as a name is a convention employed by puts and the other I/O commands. Also, stderr is used to identify the standard error output, and stdin is used to identify the standard input. Chapter 9 describes how to open other files for I/O.
Curly braces are used to group words together into a single argument. ...
Read now
Unlock full access