View previous topic :: View next topic |
Author |
Message |
manara
Joined: 15 Aug 2006 Posts: 1
|
Posted: Wed Aug 16, 2006 5:03 am Post subject: passing C# string |
|
|
Hello,
we have a fortran library with over 200 routines most of which have many output parameters, including char* or char* array.
We want to compile it with the FTN95 compiler for the .NET platform.
We were able to deal with int or float parameters, but not with the strings.
I read in the FTN95 documentation that C# strings are passed by value, so any changes made to the string from within the Fortran code are not reflected back to the C# caller.
Which is the suggested approach to deal with this problem?
Thanks Andrea Manara |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Thu Aug 17, 2006 12:34 am Post subject: passing C# string |
|
|
Andrea
Yes strings are effectively passed by value. If it is necessary for you to pass them by reference then you will need to write code to pack and unpack the strings into integer arrays bearing in mind that FTN95 stores characters as 8 bit values whilst C# stores them as 16 bit values. |
|
Back to top |
|
|
|