HP SunSoft Pascal 4.0 Bedienungsanleitung Seite 141

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 333
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 140
The C–Pascal Interface 117
6
Procedure Calls: Pascal–C
This section parallels the section, “Procedure Calls: C–Pascal” on page 93.
Earlier comments and restrictions also apply here.
Variable Parameters
Pascal passes all variable parameters by reference, which C can do, too.
Simple Types
Simple types pass in a straightforward manner, as follows:
The commands to compile and
execute IO.p and IOMain.c
hostname% pc -c IO.p
hostname% cc IO.o IOMain.c -lpc
hostname% a.out
Hello Pascal and St. Petersburg!
Hello C!
The C function, SimRef.c void SimRef(
char *t,
char *f,
char *c,
short *si,
int *i,
float *sr,
double *r)
{
*t = 1;
*f = 0;
*c = 'z';
*si = 9;
*i = 9;
*sr = 9.9;
*r = 9.9;
}
Seitenansicht 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 332 333

Kommentare zu diesen Handbüchern

Keine Kommentare