HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 142

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 141
118 Pascal 4.0 Users Guide
6
Strings of Characters
The alfa and string types pass simply; varying strings are more
complicated. All pass by reference.
The Pascal main program,
SimRefMain.p
program SimRefMain(output);
var
t, f: boolean;
c: char;
si: integer16;
i: integer;
sr: shortreal;
r: real;
procedure SimRef(
var t, f: boolean;
var c: char;
var si: integer16;
var i: integer;
var sr: shortreal;
var r: real);
external c;
begin
SimRef(t, f, c, si, i, sr, r);
writeln(t, f: 6, c: 2, si: 2, i: 2, sr :4:1, r :4:1);
end. { SimRefMain }
The commands to compile and
execute SimRef.c and
SimRefMain.p
hostname% cc -c SimRef.c
hostname% pc SimRef.o SimRefMain.p
hostname% a.out
true false z 9 9 9.9 9.9
Przeglądanie stron 141
1 2 ... 137 138 139 140 141 142 143 144 145 146 147 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag