I'm calling a function located in a fortran .dll file. This
function does nothing more than:
o input a matrix (3 by 7)
o print the elements of each row
o multiply the elements by 2, storing this to an output array
o prints the result to the screen
The C driver program:
o allocates and initializes an input and an output array
o prints the input array
o calls the fortran function, providing both arrays and their
o prints the result.
I find that when the fortran function returns, all values in the output
array are correctly set but the printout of the output array (done within fortran) hasn't happened. The input array printout appeared on the screen. but it's as if the write statements after multiply by 2 were
never executed. Very strange! Within C now, I then enter a do loop which prints out the values of the output matrix. The first time printf is called, the value of my do loop index is overwritten. It is fine before I step over printf, but is slammed during that function call. This exact code runs perfectly fine on a unix box. I've purified it and am certain neither the fortran nor the C code violates any memory boundaries.
Is there some issue related to VC++ and Visual fortran when it comes
to mixed language programming? Has this happened to anyone else? My
feeling is that the problem is happening in the fortran because the
printout fails to appear on the screen after the multiply by 2.
Thanks for any help,