z/OS Language Environment Writing Interlanguage Communication Applications
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


16-bit signed binary integer

z/OS Language Environment Writing Interlanguage Communication Applications
SA38-0684-00

Sample C usage (by Reference) Fortran subroutine
#pragma linkage (cfort,FORTRAN)
#include <stdio.h>
void cfort( short int * );
main()
{
  short int x;
  x=5;
  cfort(&x);
  printf
    ("Updated value in C: %d\n", x);
}
 
SUBROUTINE CFORT ( ARG )
INTEGER*2 ARG
PRINT *, 'FORTRAN ARG VALUE:', ARG
ARG = ARG + 1
END
Note: Because short int is an example of a parameter which must be passed using an C explicit pointer, you cannot code cfort(x), passing x by value.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014