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

  • 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 102
Separate Compilation 79
5
The program unit, inc_prog.p,
which includes the file
include.h
program inc_prog;
#include "include.h"
begin { program body}
global := 1;
writeln('From MAIN, before PROC: ', global);
proc;
writeln('From MAIN, after PROC: ', global)
end. { inc_prog }
The module unit, inc_mod.p,
which also includes the file
include.h
module inc_mod;
#include "include.h"
procedure proc;
begin
writeln('From PROC : ', global);
global := global + 1
end; { proc }
Theinclude file, include.h var
global : integer;
procedure proc; extern;
The commands to compile and
execute inc_prog.p and
inc_mod.p
hostname% pc inc_prog.p inc_mod.p
inc_prog.p:
inc_mod.p:
Linking:
hostname% a.out
From MAIN, before PROC: 1
From PROC : 1
From MAIN, after PROC: 2
Zobrazit stránku 102
1 2 ... 98 99 100 101 102 103 104 105 106 107 108 ... 332 333

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

Žádné komentáře