Pascal Programs
11
2
Compiling the Program
Use the
pc
command to compile the program and store it in the executable file
copy
. Here is the command format:
hostname% pc -o copy copy.p
Running the Program
Because the standard files
input
and
output
default to the terminal, the
program simply echoes each line you type. The program terminates when you
type the end-of-file (Control-d) character at the beginning of a line. Try it:
Redirecting I/O
To write the output to a file instead of to the terminal, use the redirection
operator,
>
, followed by a file name. For instance, to write to a file called
data
, enter the following:
hostname% copy
hello, are you listening?
hello, are you listening?
goodbye, I must go now.
goodbye, I must go now.
(Control-d)
hostname% copy > data
hello, are you listening?
goodbye, I must go now.
(Control-d)
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......