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


Address of an integer

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

Sample C usage Fortran subroutine
#pragma linkage (cfort,FORTRAN)
#include <stdio.h>
void cfort (int **);
main()
{
  int i, *temp;
  i=5;
  temp=&i;
  cfort(&temp);
  printf
    ("Updated integer value in C: %d\n", i);
}

 
SUBROUTINE CFORT ( ARG )
POINTER*4 (ARG, Y)
INTEGER*4 Y
PRINT *,
1  'FORTRAN INTEGER ARG VALUE:', Y
Y = Y + 1
END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014