Segmentation fault calling fortran function from c
asilter79
asilter79@hotmail.com
Wed Jul 4 14:32:00 GMT 2007
hi,
all i want to do is sending an integer variable from c program to fortran
function. And I want fortran function to return it back to c program. But it
fails as "Segmentation fault". Here's the code.
call_fortran.c
-----------------------
#include <stdio.h>
int main(int argc, char * argv[])
{
int a = 4;
int b = 0;
b = intgerigonder_(a);
printf("Integer which has come back here again=%d\n\n",b);
return 0;
}
Grades.F
----------------------------
c
c Grades
c
integer Function INTGERIGONDER (X)
integer X
write(*,300) 'Im sending C the integer value it has sent to me.'
300 format(A)
INTGERIGONDER=X
Return
End
-------------------------
in the fortran function, when assigning X value to INTGERIGONDER , it gives
the "SEGMENTATION FAULT" error.
why?
plz help,thanx.
--
View this message in context: http://www.nabble.com/Segmentation-fault-calling-fortran-function-from-c-tf4024692.html#a11431780
Sent from the gcc - fortran mailing list archive at Nabble.com.
More information about the Fortran
mailing list