CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

C++ fortran mixed programming: allocatable array

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 18, 2005, 23:32
Default C++ fortran mixed programming: allocatable array
Posts: n/a
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) .... ---------------------
  Reply With Quote

Old   April 19, 2005, 11:11
Default Re: C++ fortran mixed programming: allocatable arr
Posts: n/a
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.
  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
An unknown array definition in fortran morteza08 Main CFD Forum 0 June 20, 2011 04:32
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 18:56
largest one-dimensional array in fortran 77 yfyap Main CFD Forum 20 November 2, 2008 22:57
Compaq Visual Fortran - array, debug CFD Student Main CFD Forum 0 May 10, 2008 07:59
Array Visualizer in Visual Fortran Krishna Main CFD Forum 0 December 6, 2004 04:23

All times are GMT -4. The time now is 15:04.