- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A string array is declared in Fortran as:
CHARACTER*9 ARRAY(1000)
How can I pass it to a C function as an argument? I need to access it's content and update it. Using a pointer to pointer as an array name in C obviously does not work.
CHARACTER*9 ARRAY(1000)
How can I pass it to a C function as an argument? I need to access it's content and update it. Using a pointer to pointer as an array name in C obviously does not work.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just pass the address of Array(1). In C, you can treat it as char* (of length 9000) and code using calculated offsets (i.e. Array[3*9+2] is Array(4)(2:2)). I think you can also declare the argument as char Array[1000][9] (or Array[9][1000]? -- I always mix these) but I'm not versatile enough with C to tell you offhand. It's worth a try.
![](/skins/images/71A9511A625CE5D5D45FB59952A4AA71/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page