forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

passing C# string

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
manara



Joined: 15 Aug 2006
Posts: 1

PostPosted: Wed Aug 16, 2006 5:03 am    Post subject: passing C# string Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Aug 17, 2006 12:34 am    Post subject: passing C# string Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group