HP SunSoft Pascal 4.0 Manuel d'utilisateur Page 208

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 333
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 207
1 2 ... 203 204 205 206 207 208 209 210 211 212 213 ... 332 333

Commentaires sur ces manuels

Pas de commentaire