![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395137x1.png)
6
The C main program,
SimValMain.c
The commands to compile and execute SimVal.p and SimValMain.c
#include <stdio.h>
extern void SimVal( char, char, char, short,
int,
float,
double, int *);
int main(void) |
|
{ |
|
char | t = 1, f = 0; |
char | c = 'z'; |
short | si = 9; |
int | i = 9; |
float | sr = 9.9; |
double | r = 9.9; |
int | args; |
SimVal(t, f, c, si, i, sr, r, &args); printf(" args = %06o \n", args);
hostname% pc
hostname% cc SimVal.o SimValMain.c
args=111111
If no function prototype is provided for SimVal in SimValMain.c, then sr:shortreal must be changed to sr:real in SimVal.p. This change is necessary because in C, a float is promoted to double in the absence of function prototypes. In
Simple Types with
With
The | 113 |