<?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 Re: Character strings when calling Fortran from C++ in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Character-strings-when-calling-Fortran-from-C/m-p/973793#M24606</link>
    <description>Yes, hidden length argument is passed (by default, immediately after string argument.) You should either add and additional length argument in C declaration: &lt;BR /&gt;&lt;PRE&gt;extern "C" { void __stdcall RUNCMD(char* command, int len); }&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;or adjust the Fortran routine so that it doesn't expect length: &lt;BR /&gt;&lt;PRE&gt;subroutine runcmd(command) 
!DEC$ATTRIBUTES REFERENCE:: command 
character*256 command&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt;Jugoslav</description>
    <pubDate>Thu, 15 Nov 2001 19:34:33 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2001-11-15T19:34:33Z</dc:date>
    <item>
      <title>Character strings when calling Fortran from C++</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-strings-when-calling-Fortran-from-C/m-p/973792#M24605</link>
      <description>How can I call the following Fortran subroutine:   &lt;BR /&gt;   &lt;BR /&gt;subroutine runcmd(command)   &lt;BR /&gt;    character*256 command  &lt;BR /&gt;    ...  &lt;BR /&gt;    Do something ....   &lt;BR /&gt;    ... &lt;BR /&gt;return   &lt;BR /&gt;end   &lt;BR /&gt;   &lt;BR /&gt;from C++ (VC++ 6)   &lt;BR /&gt;   &lt;BR /&gt;When calling it like this:   &lt;BR /&gt;   &lt;BR /&gt;extern "C" { void __stdcall RUNCMD(char* command); }   &lt;BR /&gt;RUNCMD("This is at test");   &lt;BR /&gt;   &lt;BR /&gt;I get the following compiler error message:   &lt;BR /&gt;   &lt;BR /&gt;unresolved external Symbol _RUNCMD@4   &lt;BR /&gt;   &lt;BR /&gt;I now that it has something to do with a hidden length argument,   &lt;BR /&gt;passed with characters, but don't know what's to do.   &lt;BR /&gt;   &lt;BR /&gt;Thanks in advance</description>
      <pubDate>Thu, 15 Nov 2001 04:25:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-strings-when-calling-Fortran-from-C/m-p/973792#M24605</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-11-15T04:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Character strings when calling Fortran from C++</title>
      <link>https://community.intel.com/t5/Software-Archive/Character-strings-when-calling-Fortran-from-C/m-p/973793#M24606</link>
      <description>Yes, hidden length argument is passed (by default, immediately after string argument.) You should either add and additional length argument in C declaration: &lt;BR /&gt;&lt;PRE&gt;extern "C" { void __stdcall RUNCMD(char* command, int len); }&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;or adjust the Fortran routine so that it doesn't expect length: &lt;BR /&gt;&lt;PRE&gt;subroutine runcmd(command) 
!DEC$ATTRIBUTES REFERENCE:: command 
character*256 command&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt;Jugoslav</description>
      <pubDate>Thu, 15 Nov 2001 19:34:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Character-strings-when-calling-Fortran-from-C/m-p/973793#M24606</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-11-15T19:34:33Z</dc:date>
    </item>
  </channel>
</rss>

