6

The Pascal procedure, SimVar.p

The C main program, SimVarMain.c

Simple Types without –xl

Without -xl, simple types match, as in the following example:

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 }

#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);

}

The C–Pascal Interface

95

Page 119
Image 119
HP SunSoft Pascal 4.0 manual Simple Types without -xl, Pascal procedure, SimVar.p