7

When you compile the Pascal routine without the -calignoption, the program does not work correctly.

Compile with the -calignoption. The program now works correctly.

hostname% pc -c DayWeather.p

hostname% CC DayWeather.o DayWeatherMain.cc -lpchostname% a.out

day = ''

weather = ' Sun'

hostname% pc -calign -c DayWeather.p

hostname% CC DayWeather.o DayWeatherMain.cc -lpchostname% a.out

day = 'Sunday' weather = 'Sunny'

Arguments Passed by Value

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

150

Pascal 4.0 User’s Guide

Page 174
Image 174
HP SunSoft Pascal 4.0 Arguments Passed by Value, Hostname% pc -c DayWeather.p, Hostname% pc -calign -c DayWeather.p, 150