CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   C++ fortran mixed programming: allocatable array (https://www.cfd-online.com/Forums/main/9044-c-fortran-mixed-programming-allocatable-array.html)

vito April 18, 2005 23:32

C++ fortran mixed programming: allocatable array
 
I am now confronted a problem in my CFD programme. How to transfer an allocatable array (double ** A, A[i][j]) as argument from C++ to Fortran? The following code doesn't work. ----------C.cpp----------- double **A;

myf(A,2,2); ---------------------

----------F.for----------- subroutine myf(A,m,n) real*8 A(m,n) .... ---------------------

Steve April 19, 2005 11:11

Re: C++ fortran mixed programming: allocatable arr
 
You can't do it. Your C array comprises an array of pointers, each pointing to a 1D array of doubles, none of which is guaranteed to be anywhere near any other one.


All times are GMT -4. The time now is 11:58.