Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28486 Discussions

mixed-language, c/fortran: pointer to pointer to vector

taylordotruss
Beginner
245 Views
Hi,
Based on posts I have read on this board, I have been able to call various c routines that return a pointer to a vector and associate it with a vector withinIVF using "POINTER(ptrToVector, vector)".
I now need to write a fortran interface code for a subroutine that returns a pointer to a pointer

void find_perm(vec* a, int** perm);

The returned permutation is used subsequently to permute another vector as:

vec* permute(vec* b, int* perm);

I have learned a lot by browsing through archieves. My knowledge of c is primitive. I just need to use some c routines.
Many thanks in advance.
Russ
0 Kudos
1 Reply
taylordotruss
Beginner
245 Views
Hello,
I found a solution to the problem on comp.lang.fortran posted by Jugoslav.
It seems to work. I must confess, I wasn't at all sure with all those ** as to "who" is pointing to "what" and "why"? After experimenting with Jugoslav's solution, I am begninning to understand the "who" and "what" part. The "why" part can wait.
To Jugoslav, Thank you.
Russ

Message Edited by taylordotruss@yahoo.com on 07-05-2005 08:18 AM

0 Kudos
Reply