Please look at these two small functions. I passed an long interger into the C function and changed its value and passed back into fortran. but the value is not correct. If I didn’t use the long interger, the value is correct. Why?
a = -10
end program foo
void boo_(long int* a)
printf(“PASSIN VALUE: %d\n”, *a);
printf(“Within boo subroutine a = %d\n”, *a);
You can try to run these two code and if you chang the long int and integer*8 as int and integer respectively, you will see the a value after boo function all is changed to 100 but this long int simply doesn’t work.