HP SunSoft Pascal 4.0 Manuel d'utilisateur Page 183

  • 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 182
The C++–Pascal Interface 159
7
Function Return Values
Function return values match types in the same manner as with parameters.
They pass in much the same way.
The Pascal main program,
SimValMain.p
program SimValMain(output);
var
t: boolean := true;
f: boolean := false;
c: char := 'z';
si:integer16:= 9;
i: integer := 9;
sr:shortreal:= 9.9;
r: real := 9.9;
args: integer;
procedure SimVal(
t, f: boolean;
c: char;
si:integer16;
i: integer;
sr:shortreal;
r: real;
var Reply: integer); external C;
begin
SimVal(t, f, c, si, i, sr, r, args);
writeln(' args = ', args :7 oct);
end.
The commands to compile and
execute SimVal.cc and
SimValMain.p
hostname% CC -c SimVal.cc
hostname% pc SimVal.o SimValMain.p
hostname% a.out
args = 111111
Vue de la page 182
1 2 ... 178 179 180 181 182 183 184 185 186 187 188 ... 332 333

Commentaires sur ces manuels

Pas de commentaire