Arguments passed by value – HP SunSoft Pascal 4.0 User Manual

Page 174

Advertising
background image

150

Pascal 4.0 User’s Guide

7

Arguments Passed by Value

C++ arguments can be passed by value. In this section, we describe how they
work with Pascal.

When you compile the Pascal
routine without the

-calign

option, the program

does not work correctly.

hostname% pc -c DayWeather.p

hostname% CC DayWeather.o DayWeatherMain.cc -lpc

hostname% a.out

day = ''

weather = ' Sun'

Compile with the

-calign

option. The program now
works correctly.

hostname% pc -calign -c DayWeather.p

hostname% CC DayWeather.o DayWeatherMain.cc -lpc

hostname% a.out

day = 'Sunday'

weather = 'Sunny'

Advertising