here is my code:
Visual C:
fortran :
It`s ok to compile these codes together.
but I can not get the right answer after debug, the data seems no connection with fortran dll.
Here are the outputs:
dd -1.0737418e+008 float
bb 2.0000000 float
cc 3.0000000 float
aa 1.0000000 float
can somebody tell me what`s wrong with it?
thank you very much.
Visual C:
Code:
********************************** #include <stdio.h> #include <stdlib.h> extern __declspec(dllimport) void _stdcall abcd(float *aa , float *bb , float *cc , float *dd); void main (void) { float aa=1.0; float bb=2.0; float cc=3.0; float dd; abcd(&aa,&bb,&cc,&dd); printf("dd=%f",dd); return; } *******************************
Code:
******************************* SUBROUTINE abcd(aa,bb,cc,dd) !DEC$ ATTRIBUTES DLLEXPORT::abcd !DEC$ ATTRIBUTES STDCALL,DECORATE, ALIAS:'abcd'::abcd REAL aa REAL bb REAL cc REAL dd dd=( aa+bb)*cc RETURN END ************************
but I can not get the right answer after debug, the data seems no connection with fortran dll.
Here are the outputs:
dd -1.0737418e+008 float
bb 2.0000000 float
cc 3.0000000 float
aa 1.0000000 float
can somebody tell me what`s wrong with it?
thank you very much.
Comment