<div dir="ltr"><div style>#include <stdio.h></div><div>void FunctionFread(const char* szFile)</div><div>{</div><div><span class="" style="white-space:pre"> </span>FILE *fp = fopen(szFile, "rb");</div><div><span class="" style="white-space:pre"> </span>if (fp == NULL)</div>
<div><span class="" style="white-space:pre"> </span>{</div><div><span class="" style="white-space:pre"> </span>return;</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span></div>
<div><span class="" style="white-space:pre"> </span>int ofs[2], len;</div><div><span class="" style="white-space:pre"> </span>int nReadNum = fread( ofs, sizeof(int), 2, fp );</div><div><br></div><div><span class="" style="white-space:pre"> </span>if ( nReadNum != 2 )</div>
<div><span class="" style="white-space:pre"> </span>{</div><div><span class="" style="white-space:pre"> </span>fclose(fp);</div><div><span class="" style="white-space:pre"> </span>return;</div><div><span class="" style="white-space:pre"> </span>}</div>
<div><span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre"> // warning: The left operand of '-' is a garbage value</span></div><div><span class="" style="white-space:pre"> </span>len = ofs[1] - ofs[0];</div>
<div><span class="" style="white-space:pre"> </span>printf("length=%d\n", len);</div><div><span class="" style="white-space:pre"> </span>fclose(fp);</div><div>}</div></div>