<?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 I have also done in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039453#M112685</link>
    <description>&lt;P&gt;I have also done&lt;/P&gt;

&lt;P&gt;myvar = 'Hello world!' // CHAR(0)&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;WRITE (myvar, *) 'Hello world!', CHAR(0)&lt;/P&gt;

&lt;P&gt;and I THINK that worked also. Would have to do some digging to know for sure. Perhaps Steve or other could comment on this approach?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2015 19:40:27 GMT</pubDate>
    <dc:creator>dboggs</dc:creator>
    <dc:date>2015-03-25T19:40:27Z</dc:date>
    <item>
      <title>How do I specify a c-string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039446#M112678</link>
      <description>&lt;P&gt;I'm trying some code Steve posted years ago:&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ! Code for message box&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret = MessageBox (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetForegroundWindow(), &amp;amp; ! Handle to window&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Hello World!"C,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; ! Text (don't forget C-string)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Example of using MessageBox"C, &amp;amp; ! Caption for title bar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MB_ICONINFORMATION + MB_OK) ! Type flags&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	[/fortran]&lt;/P&gt;

&lt;P&gt;which works. In reality I want to post some useful information that is contained in a character variable but I can't figure out the correct syntax. In fact the only thing I've tried is using LOC but that doesn't compile.&lt;/P&gt;

&lt;P&gt;[fortran]&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(len=:), allocatable :: myvar&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myvar = 'Hello World!'&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ! Code for message box&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret = MessageBox (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetForegroundWindow(), &amp;amp; ! Handle to window&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;LOC(myvar)&lt;/STRONG&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; ! Text (don't forget C-string)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Example of using MessageBox"C, &amp;amp; ! Caption for title bar&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MB_ICONINFORMATION + MB_OK) ! Type flags&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	[/fortran]&lt;/P&gt;

&lt;P&gt;Compiling with Intel(R) Visual Fortran Compiler XE 14.0.1.139 [Intel(R) 64]...&lt;/P&gt;

&lt;P&gt;error #6633: The type of the actual argument differs from the type of the dummy argument.&amp;nbsp;&amp;nbsp; [LOC]&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 09:31:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039446#M112678</guid>
      <dc:creator>Simon_Geard</dc:creator>
      <dc:date>2014-06-12T09:31:10Z</dc:date>
    </item>
    <item>
      <title>You don't use LOC, you just</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039447#M112679</link>
      <description>&lt;P&gt;You don't use LOC, you just pass myvar. But you need to set the value of myvar as "'Hello World!'C&lt;/P&gt;

&lt;P&gt;Alternatively you could pass TRIM(myvar)//''C&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 14:34:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039447#M112679</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-06-12T14:34:06Z</dc:date>
    </item>
    <item>
      <title>The "C syntax is an Intel</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039448#M112680</link>
      <description>&lt;P&gt;The "C syntax is an Intel extension, right? It's probably better to use the c_null_char variable in iso_c_binding.&amp;nbsp; Example:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;use iso_c_binding,  only: c_null_char
character(len=:), allocatable :: myvar
myvar = 'Hello World!'//c_null_char&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 14:54:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039448#M112680</guid>
      <dc:creator>Jacob_Williams</dc:creator>
      <dc:date>2014-06-12T14:54:21Z</dc:date>
    </item>
    <item>
      <title>Yes, it's an extension,but so</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039449#M112681</link>
      <description>&lt;P&gt;Yes, it's an extension,but so is the use of Windows API routines. I agree that use of C_NULL_CHAR is a fine approach.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 16:01:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039449#M112681</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-06-12T16:01:01Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039450#M112682</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Yes, it's an extension,but so is the use of Windows API routines. I agree that use of C_NULL_CHAR is a fine approach.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;If the C postfix on strings is a language extension why no warning when compiling using /stand:f08?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 16:22:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039450#M112682</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2014-06-12T16:22:24Z</dc:date>
    </item>
    <item>
      <title>Because we missed adding that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039451#M112683</link>
      <description>&lt;P&gt;Because we missed adding that check. Already filed as issue&amp;nbsp;DPD200246505.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 17:08:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039451#M112683</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-06-12T17:08:41Z</dc:date>
    </item>
    <item>
      <title>Fixed for a release later</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039452#M112684</link>
      <description>&lt;P&gt;Fixed for a release later this year.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2015 18:28:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039452#M112684</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-23T18:28:23Z</dc:date>
    </item>
    <item>
      <title>I have also done</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039453#M112685</link>
      <description>&lt;P&gt;I have also done&lt;/P&gt;

&lt;P&gt;myvar = 'Hello world!' // CHAR(0)&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;WRITE (myvar, *) 'Hello world!', CHAR(0)&lt;/P&gt;

&lt;P&gt;and I THINK that worked also. Would have to do some digging to know for sure. Perhaps Steve or other could comment on this approach?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:40:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039453#M112685</guid>
      <dc:creator>dboggs</dc:creator>
      <dc:date>2015-03-25T19:40:27Z</dc:date>
    </item>
    <item>
      <title>The first is fine. One could</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039454#M112686</link>
      <description>&lt;P&gt;The first is fine. One could also use C_NULL_CHAR from ISO_C_BINDING instead of CHAR(0).&lt;/P&gt;

&lt;P&gt;The second will insert a blank at the beginning of myvar - I don't think you want that. You should use an explicit format rather than list-directed. It does seem a rather high-overhead method of getting the NULL in there.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:48:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039454#M112686</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-25T19:48:02Z</dc:date>
    </item>
    <item>
      <title>Thanks Steve.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039455#M112687</link>
      <description>&lt;P&gt;Thanks Steve.&lt;/P&gt;

&lt;P&gt;You're right of course about the list-directed format in case 2. I know this well. Kind of a separate issue though so I didn't even think about it here.&lt;/P&gt;

&lt;P&gt;A rather "high-overhead" method of getting the NULL? Maybe, but there are certainly times when one needs to WRITE something into a string--perhaps several different variable values--in which case merely adding an additional value of CHAR(0) is pretty straightforward.&lt;/P&gt;

&lt;P&gt;I like these techniques because they're 100 percent Fortran. No USE statement required referencing something that many people would have to look up. In fact I never heard of ISO_C_BINDING, know nothing about it, and probably have no use for it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 13:43:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039455#M112687</guid>
      <dc:creator>dboggs</dc:creator>
      <dc:date>2015-03-26T13:43:11Z</dc:date>
    </item>
    <item>
      <title>Sure, there are cases where</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039456#M112688</link>
      <description>&lt;P&gt;Sure, there are cases where the WRITE makes sense. Concatenating with CHAR(0) is fine. But as for ISO_C_BINDING, if you're doing anything with null-terminated strings you are probably interfacing with C code and you'll find that useful for doing so in a standard manner.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 14:04:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039456#M112688</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-26T14:04:37Z</dc:date>
    </item>
    <item>
      <title>So what's non-standard about</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039457#M112689</link>
      <description>&lt;P&gt;So what's non-standard about CHAR(0)?&lt;BR /&gt;
	Is it the CHAR or the '0' ?&lt;BR /&gt;
	I cannot believe that the string terminating character presently used (Hex 0) is likely to be changed in future?&lt;BR /&gt;
	Too many things would break, surely?&lt;BR /&gt;
	&lt;BR /&gt;
	Are we not being somewhat paranoid that Microsoft might change the terminator in future?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 17:15:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039457#M112689</guid>
      <dc:creator>Anthony_Richards</dc:creator>
      <dc:date>2015-03-26T17:15:27Z</dc:date>
    </item>
    <item>
      <title>I did not see anyone suggest</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039458#M112690</link>
      <description>&lt;P&gt;I did not see anyone suggest that CHAR(0) was nonstandard.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 18:45:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039458#M112690</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-26T18:45:14Z</dc:date>
    </item>
    <item>
      <title>Quote:dboggs wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039459#M112691</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;dboggs wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;... In fact I never heard of ISO_C_BINDING, know nothing about it, and probably have no use for it.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;ISO_C_BINDING is simply means to an end, that of a standard way of achieving interoperability with C. &amp;nbsp;This feature introduced in Fortran starting with Fortran 2003 standard is a very valuable addition in my opinion.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 19:23:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039459#M112691</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2015-03-26T19:23:15Z</dc:date>
    </item>
    <item>
      <title>I would say that ISO_C</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039460#M112692</link>
      <description>&lt;P&gt;I would say that ISO_C_BINDING is one part of the C interoperability features of F2003. It is not the whole of it. I know that a lot of people use ISO_C_BINDING to mean C interoperability, but that's imprecise. Note that Fortran 2015 significantly extends C interoperability - I am in the middle of writing a Doctor Fortran post on this topic.&lt;/P&gt;

&lt;P&gt;I brought up ISO_C_BINDING because it contains standard-specified definitions of things useful in interoperating with C, including named constants for things such as NULL, LF and CR.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 19:49:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039460#M112692</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-26T19:49:34Z</dc:date>
    </item>
    <item>
      <title>Quote:Anthony Richards wrote</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039461#M112693</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Anthony Richards wrote:&lt;BR /&gt;So what's non-standard about CHAR(0)?&lt;BR /&gt;
	Is it the CHAR or the '0' ?&lt;BR /&gt;
	&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;If it is a nice day outside, you might be better off going for a walk rather than reading this, but speaking of Fortran processors in general (rather than ifort specifically), CHAR(0) returns a character of default character kind.&amp;nbsp; There's no requirement that the default character kind be the interoperable C character kind, and there's no guarantee that the character number zero in the collating sequence for default character is the all-bits-zero null character used to terminate C strings.&amp;nbsp; CHAR(0) is standard conforming, but the behaviour of that standard conforming code fragment is processor dependent.&lt;/P&gt;

&lt;P&gt;Finding a Fortran processor implementation where CHAR(0) doesn't do what you would expect might be a little difficult though.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2015 05:02:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039461#M112693</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2015-03-28T05:02:32Z</dc:date>
    </item>
    <item>
      <title>I had a nice walk outside and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039462#M112694</link>
      <description>&lt;P&gt;I had a nice walk outside and decided that achar(0) is "righter" than char(0)..... :-)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2015 09:22:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039462#M112694</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2015-03-28T09:22:35Z</dc:date>
    </item>
    <item>
      <title>This is perhaps why C_NULL</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039463#M112695</link>
      <description>&lt;P&gt;This is perhaps why C_NULL_CHAR is a better choice as you're guaranteed it is the right character kind.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2015 23:39:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-do-I-specify-a-c-string/m-p/1039463#M112695</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-28T23:39:20Z</dc:date>
    </item>
  </channel>
</rss>

