The C–Pascal Interface
95
6
Simple Types without
–xl
Without
-xl
, simple types match, as in the following example:
The Pascal procedure,
SimVar.p
procedure SimVar(
var t, f: boolean;
var c: char;
var si: integer16;
var i: integer;
var sr: shortreal;
var r: real);
begin
t := true;
f := false;
c := 'z';
si := 9;
i := 9;
sr := 9.9;
r := 9.9;
end; { SimVar }
The C main program,
SimVarMain.c
#include <stdio.h>
extern void SimVar(char *, char *, char *, short *,
int *, float *, double *);
int main(void)
{
char
t, f, c;
short
si;
int
i;
float
sr;
double
r;
SimVar(&t, &f, &c, &si, &i, &sr, &r);
printf(" %08o %08o %c %d %d %3.1f %3.1f \n",
t, f, c, si, i, sr, r);
}
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......