HP SunSoft Pascal 4.0 Uživatelský manuál Strana 208

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 333
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 207
184 Pascal 4.0 Users 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
Zobrazit stránku 207
1 2 ... 203 204 205 206 207 208 209 210 211 212 213 ... 332 333

Komentáře k této Příručce

Žádné komentáře