offsetof function in c++
<p>here is code   </p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stddef.h&gt;

struct mystruct {
  char singlechar;
  char arraymember[10];
  char anotherchar;
};

int main ()
{
  printf ("offsetof(mystruct,singlechar) is %d\n",offsetof(mystruct,singlechar));
  printf ("offsetof(mystruct,arraymember) is %d\n",offsetof(mystruct,arraymember));
  printf ("offsetof(mystruct,anotherchar) is %d\n",offsetof(mystruct,anotherchar));

  return 0;
}
</code></pre>

<p>output of which is</p>

<pre><code>offsetof(mystruct,singlechar) is 0
offsetof(mystruct,arraymember) is 1
offsetof(mystruct,anotherchar) is 11
</code></pre>

<p>i have read this documentation</p>

<pre><code>http://www.cplusplus.com/reference/clibrary/cstddef/offsetof/
</code></pre>

<p>but i did not understand no not because of my english but i dont understand  documenattion itself  please can anybody give me a little example or tell me how it works?
 thanks</p>
