2

I have to write some code that mixes Fortran 77 with C. Suppose I have a C function with signature

void foo(int ** x);

Thus, if I were calling foo in C, I might have

int x_val = 42;
int * x_ptr = &x_val;
foo(&x_ptr);

Now suppose I have this in Fortran 77:

integer x
x = 42

If I pass x to foo, that would be equivalent to passing "&x" to foo in C code, but that would not work. Do I need to create a Cray pointer of x and then pass the Cray pointer to foo? Would that work? Is there any way to do this without Cray pointers? Thanks!

Amittai Aviram
  • 2,270
  • 3
  • 25
  • 32

0 Answers0