<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Passing array of strings to Fortran in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767589#M20942</link>
    <description>Not "variable length" - what you have here is an array of strings all the same length. What would be passed is the starting address of the strings and, as a "hidden" parameter after all the explicit arguments, the string length passed by value (and of type size_t, not int!) I'm not immediately certain how you would declare such a thing in C - it is not the same as an array of strings in C which is actually an array of pointers.</description>
    <pubDate>Thu, 07 Apr 2011 17:42:46 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2011-04-07T17:42:46Z</dc:date>
    <item>
      <title>Passing array of strings to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767588#M20941</link>
      <description>I am calling a 3rd party Fortran DLL from C.  The manual describes a function whose argument include: character units(*)*(*)&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This I understand refers to a variable-length array of strings.&lt;/P&gt;&lt;BR /&gt;In this situation does Fortran expect a string length argument for each of the strings in the array? If so should the length arguments be passed individually or also in an array?&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in adv.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2011 17:17:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767588#M20941</guid>
      <dc:creator>Martin__Paul</dc:creator>
      <dc:date>2011-04-07T17:17:54Z</dc:date>
    </item>
    <item>
      <title>Passing array of strings to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767589#M20942</link>
      <description>Not "variable length" - what you have here is an array of strings all the same length. What would be passed is the starting address of the strings and, as a "hidden" parameter after all the explicit arguments, the string length passed by value (and of type size_t, not int!) I'm not immediately certain how you would declare such a thing in C - it is not the same as an array of strings in C which is actually an array of pointers.</description>
      <pubDate>Thu, 07 Apr 2011 17:42:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767589#M20942</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-04-07T17:42:46Z</dc:date>
    </item>
    <item>
      <title>Passing array of strings to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767590#M20943</link>
      <description>Thanks. The problem is the library I am calling from C is 3rd party so I can't change its interface. I've tried all the standard things like C-style arrays but as you point out this is not of the same type. Any suggestions gratefully received!</description>
      <pubDate>Thu, 07 Apr 2011 17:53:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767590#M20943</guid>
      <dc:creator>Martin__Paul</dc:creator>
      <dc:date>2011-04-07T17:53:26Z</dc:date>
    </item>
    <item>
      <title>Passing array of strings to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767591#M20944</link>
      <description>I was not suggesting you change the third-party interface. I was explaining how you would call this from C. In the simple case of a single argument that is this CHARACTER(*)(*) array, it would be something like:&lt;BR /&gt;&lt;BR /&gt;fsub(char * string, size_t string_len)&lt;BR /&gt;&lt;BR /&gt;where "string" is a series of fixed-length strings (not nul-terminated). Perhaps you can declare it as something like:&lt;BR /&gt;&lt;BR /&gt;char[40][10]&lt;BR /&gt;&lt;BR /&gt;assuming 10 elements of 40 characters each, but my C is rusty enough that I am not sure - this itself may end up as an array of pointers which you don't want. Maybe char[40*10] and fill it in as needed.</description>
      <pubDate>Thu, 07 Apr 2011 18:06:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767591#M20944</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-04-07T18:06:36Z</dc:date>
    </item>
    <item>
      <title>Passing array of strings to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767592#M20945</link>
      <description>&lt;P&gt;The second suggestion worked - indeed the point about char[][] resolving to an array of pointers was correct. As it turned out the library expects strings up to length 8 characters, so I was able to pass a single char* containing the individual string components, e.g.:&lt;/P&gt;&lt;P&gt;char[] = "aaa   bbb   ccc   ddd   eee   fff   ";&lt;/P&gt;&lt;P&gt;This worked - thank you for the swift replies.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2011 19:38:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-array-of-strings-to-Fortran/m-p/767592#M20945</guid>
      <dc:creator>Martin__Paul</dc:creator>
      <dc:date>2011-04-08T19:38:29Z</dc:date>
    </item>
  </channel>
</rss>

