String returned from C# to Fortran - problem

anthonyrichards
Total Points:
4,222
Status Points:
3,722
Brown Belt
November 27, 2008 2:05 AM PST
Rate
 
#5 Reply to #4
If you are sending strings to a program written with any type of 'C'- language, do you not have to terminate each string with the null (CHAR(0)) character first? That's how C knows where the string ends. Any string length argument returned by Fortran must therefore include the terminating null character in the count so the C-side string length must match or exceed this length.
Also, whenever a 'C'-type program sends a reference to a string, the string will be terminated with a null character too, so looking for the null character lets you find the string's length.


Intel Software Network Forums Statistics

8290 users have contributed to 31236 threads and 99111 posts to date.
In the past 24 hours, we have 7 new thread(s) 19 new posts(s), and 24 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member zq.x