- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am calling a 3rd party Fortran DLL from C. The manual describes a function whose arguments are
integer nunits,ierr
character units(*)*(*)
units (in) list of units
nunits (in) number of units
ierr (out) error flag
In C I am declaring the arguments to the function as follows:
int nunits = 2;
int iFail = 0;
char** myCache = new char*[3];
myCache[0] = "S1";
myCache[1] = "S2";
The function call is thus:
SetUnits(myCache, &nunits, &iFail);
but this results in an access violation.
I think it's likely to have to do with the string array. What is the C equivalent of (*)*(*)?
Thanks in adv.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried passing separate string arguments in for character units(*)*(*) and it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you talk about the "C equivalent" of Fortran strings, you should be considering iso_c_binding. This supports interoperability with an array of C_CHAR.

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