Running the program, Renaming the executable file – HP SunSoft Pascal 4.0 User Manual

Page 33

Advertising
background image

Pascal Programs

9

2

Running the Program

To run the program, enter

a.out

at the prompt. The output of

temp.p

is then

displayed:

Renaming the Executable File

It is inconvenient to have the result of every compilation in a file called

a.out

.

If such a file already exists, it is overwritten. You can avoid this in either of the
two following ways:

Change the name of

a.out

after each compilation with the

mv

command:

hostname% mv a.out temp

Use the compiler

–o

option to name the output executable file. This

example places the executable code in the file

temp

:

hostname% pc –o temp temp.p

hostname% a.out

Fahrenheit Celsius

---------- -------

32

0.00

33

0.56

34

1.11

35

1.67

36

2.22

37

2.78

38

3.33

39

3.89

40

4.44

41

5.00

42

5.56

43

6.11

44

6.67

45

7.22

46

7.78

47

8.33

48

8.89

49

9.44

50

10.00

Advertising