An INTEGER variable is defined as a short int in C. You are passed a pointer to the data location. This example shows how to access an INTEGER from a C routine.
BASIC Program
10 INTEGER I
20 I=256
30 CALL Imp3( I )
40 PRINT I
50 END
60 SUB Imp3( INTEGER A )
70 A = A * 3
80 SUBEND
Prototype
1 END
10 SUB Imp3( INTEGER A )
20 SUBEND
C Program
#include "csub.h"
imp3( npar, a )
int npar; /* number of parameters */
intptr a; /* integer data pointer */
{
*a = *a * 3; /* return a new value */
return( 0 ); /* no errors */
}
|