184
Pascal 4.0 User’s Guide
8
Function Return Values
Function return values match types the same as with parameters, and they
pass in much the same way. See “Procedure Calls: FORTRAN-Pascal” on
page 168.
The FORTRAN main program,
PassPtrmain.f
. In the
FORTRAN main program, the
name is converted to lowercase.
Uppsercase is ignored.
program PassPtrmain
integer i
double precision d
integer iptr, dptr
pointer ( iPtr, i ), ( dPtr, d )
iPtr = malloc( 4 )
dPtr = malloc( 8 )
i = 0
d = 0.0
call PassPtr ( iPtr, dPtr )
write( *, "(i2, f4.1)" ) i, d
stop
end
The commands to compile and
execute
PastPtr.p
and
PassPtrmain.f
hostname% pc -c PassPtr.p
hostname% f77 PassPtr.o PassPtrmain.f -lpfc -lpc
PassPtrmain.f:
MAIN passptrmain:
hostname% a.out
9 9.9
Содержание 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: ......