<?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: using sizeof in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624882#M32751</link>
    <description>sizeof(x) should be 400 or 800, depending upon how big a 'long' is.</description>
    <pubDate>Tue, 13 Sep 2005 13:09:38 GMT</pubDate>
    <dc:creator>David Jones_21</dc:creator>
    <dc:date>2005-09-13T13:09:38Z</dc:date>
    <item>
      <title>using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624880#M32749</link>
      <description>On the microsoft platform using Visual Studio it is valid to declare variables and use the sizeof() method on the variable to get the size. For instance I can declare the following variables (below) and use the &lt;BR /&gt;sizeof(variable name) and the correct size will return.&lt;BR /&gt;&lt;BR /&gt;long x[10][10];&lt;BR /&gt;char y[20];&lt;BR /&gt;&lt;BR /&gt;struct XXX&lt;BR /&gt;   {&lt;BR /&gt;   long x[10][10];&lt;BR /&gt;   char y[20];&lt;BR /&gt;   }strct;&lt;BR /&gt;&lt;BR /&gt;sizeof(x) is 100;&lt;BR /&gt;sizeof(y) is 20;&lt;BR /&gt;sizeof(strct) is 120;&lt;BR /&gt;&lt;BR /&gt;I have done some testing on the itanium and found it works! Is this just a fluke or is this a valid way to do this on the OpenVMS platform?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Sep 2005 10:15:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624880#M32749</guid>
      <dc:creator>Eric_369</dc:creator>
      <dc:date>2005-09-13T10:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624881#M32750</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;This works. I think that this is part of the ANSIC standard.&lt;BR /&gt;&lt;BR /&gt;The documentation:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/commercial/c/docs/6180profile_016.html#index_x_563" target="_blank"&gt;http://h71000.www7.hp.com/commercial/c/docs/6180profile_016.html#index_x_563&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;says that the parameter to sizeof can be an expression.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Tue, 13 Sep 2005 10:25:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624881#M32750</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2005-09-13T10:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624882#M32751</link>
      <description>sizeof(x) should be 400 or 800, depending upon how big a 'long' is.</description>
      <pubDate>Tue, 13 Sep 2005 13:09:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624882#M32751</guid>
      <dc:creator>David Jones_21</dc:creator>
      <dc:date>2005-09-13T13:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624883#M32752</link>
      <description>Bojan,&lt;BR /&gt;   Thanks much!&lt;BR /&gt;&lt;BR /&gt;Dave,&lt;BR /&gt;   Thanks, I calculated wrong. It's 400&lt;BR /&gt;and 420 for 'strct.'&lt;BR /&gt;Eric</description>
      <pubDate>Tue, 13 Sep 2005 13:17:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624883#M32752</guid>
      <dc:creator>Eric_369</dc:creator>
      <dc:date>2005-09-13T13:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624884#M32753</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;  One thing to beware of... the sizes of objects might differ between your Windows and OpenVMS code. The OpenVMS compiler, by default, will align fields within a structure on their natural boundaries, inserting "padding" where necessary. This may result in a structure larger than the simple sum of the component fields. Usually this isn't a problem, but if you're expecting to share binary data files across platforms, you might need to check that the structures are compatible.</description>
      <pubDate>Tue, 13 Sep 2005 17:44:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624884#M32753</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2005-09-13T17:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624885#M32754</link>
      <description>John, &lt;BR /&gt;   Thanks! When we share data across platforms in the Client/Server environment we are using the #pragma pack(1) on our Windows clients and &lt;BR /&gt;#pragma nomember_alignment on the HP OpenVMS server aligning both structure members on byte boundries.&lt;BR /&gt;Eric</description>
      <pubDate>Wed, 14 Sep 2005 09:59:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624885#M32754</guid>
      <dc:creator>Eric_369</dc:creator>
      <dc:date>2005-09-14T09:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: using sizeof</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624886#M32755</link>
      <description>If this is an existing software, o.k. let it be so, but for a new project starting now, DON'T do it, You will regret later, e.g. when You have to port to a another architecture or just new "clients" programming in a different langauage.&lt;BR /&gt;Better use a portable data format like XDR or XML.</description>
      <pubDate>Wed, 14 Sep 2005 10:07:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-sizeof/m-p/3624886#M32755</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2005-09-14T10:07:09Z</dc:date>
    </item>
  </channel>
</rss>

