HP SunSoft Pascal 4.0 Bedienungsanleitung Seite 140

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 333
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 139
116 Pascal 4.0 Users Guide
6
Input and Output
If your C main program calls a Pascal procedure that does I/O, then include
the following code in the C main program before you call the Pascal procedure:
Also, in the C main program just before exit, add the following line:
See this example:
The commands to compile and
execute RetReal.p and
RetRealMain.c
hostname% pc -c RetReal.p
hostname% cc RetReal.o RetRealMain.c
hostname% a.out
3.000000
__PC0__PCSTART();
__PC0__PCEXIT();
The Pascal procedure, IO.p procedure IO;
begin
writeln('Hello Pascal and St. Petersburg!');
end;
The C main program, IOMain.c #include <stdio.h>
extern void IO();
int main(void)
{
IO();
printf("Hello C! \n");
}
Seitenansicht 139
1 2 ... 135 136 137 138 139 140 141 142 143 144 145 ... 332 333

Kommentare zu diesen Handbüchern

Keine Kommentare