
Originally Posted by
tfmp
I was a little confused, and now understand what your codes mean.
A basic question: If an array is created with FortranMatrix as follows
void cppFN()
{
FortranMatrix < int, 3, 5 > intArray;
intArray(1,2) =1;
...
}
void cppFN()
{
FortranMatrix < int, 3, 5 > intArray;
intArray(1,2) =1;
...
}
To copy to clipboard, switch view to plain text mode
a user does not need to delete the intArray. It will be cleared by OS when leaving the cppFN(). Is my understanding correct?

Originally Posted by
d_stranz
Yes, correct.
but remember that in cpp code, you should be using 'at' to access the array elements, e.g
void cppFN()
{
FortranMatrix < int, 3, 5 > intArray;
intArray.at(1,2) = 1; // not 'intArray(1,2)' <-- fortran-only syntax
...
}
void cppFN()
{
FortranMatrix < int, 3, 5 > intArray;
intArray.at(1,2) = 1; // not 'intArray(1,2)' <-- fortran-only syntax
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks