size of struct without use sizeof keyword
<p>here is code which returns  size of struct without   using sizeof keyword</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;
struct  point{
    int x;
    int y;
    };
struct point pt={0,0};

int main(){
    point *ppt=&amp;pt;
    unsigned char *p1,*p2;
    p1=(unsigned char *)ppt;
    p2=(unsigned char *)++ppt;
    printf("%d",p2-p1);


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

<p>it returns 8 as i understand because  sizeof char is 1 byte  and this struct   contains integer  types first it convers it to char using char   pointers and returns sizeof char? or?i dont understand exactly how it works
thanks </p>
