Yeah you are right. The value of block * 102400 will be huge.
[ Please ALWAYS post code inside code-blocks]

So, you can use this :

Code: C
fseek(pFile, 0, SEEK_SET);
for(int block = 0; block < MAX_BLOCKS; ++block)
      fwrite(buff, 1, 102400, file);
I think the write cursor will automatically move till the end of the written block.
So your pointer is auto-adjusted.

Last edited by SaswatPadhi; 2Jun2009 at 08:02..