tellp is returning the wrong value
<p>In the following snipped, I am calculating a position for a file to seekp to, for writing.</p>

<p>I then try to print that position. It is returning an incorrect value;</p>

<pre><code>printf("nXBlocks: %i nYBlocks: %i posX: %i, posY: %i, blockheight: %i, blockwidth: %i \n", 
nXBlocks,nYBlocks, tilePosX,  tilePosY ,  XBlockSize, YBlockSize );
binfile-&gt;seekp((tilePosX*poBand-&gt;GetYSize()*XBlockSize)*sizeof(uint16_t) + (tilePosY * XBlockSize*YBlockSize)*sizeof(uint16_t));
size_t pos = binfile-&gt;tellp();
cout&lt;&lt;"Multiplication output: " 
    &lt;&lt;(tilePosX*poBand-&gt;GetYSize()*XBlockSize)*sizeof(uint16_t) + (tilePosY * XBlockSize*YBlockSize)*sizeof(uint16_t)
    &lt;&lt;endl;
cout &lt;&lt; "Put pointer positions: " &lt;&lt; pos &lt;&lt; endl;
binfile-&gt;write((char *)&amp;sixteenBitData, sizeof(uint16_t)*bufSizeX*bufSizeY);
</code></pre>

<p>I am getting a output of</p>

<p>Put pointer position: 18446744073709551615</p>

<p>For every call to the tellp</p>

<p>Instead of values based on the values I am passing to seekp</p>

<p>edit: some output of the first few...</p>

<pre><code>nXBlocks: 34 nYBlocks: 29 posX: 0, posY: 0, blockheight: 1024, blockwidth: 1024
Multiplication output: 0
Put pointer positions: 0
nXBlocks: 34 nYBlocks: 29 posX: 0, posY: 1, blockheight: 1024, blockwidth: 1024
Multiplication output: 2097152
Put pointer positions: 18446744073709551615
nXBlocks: 34 nYBlocks: 29 posX: 0, posY: 2, blockheight: 1024, blockwidth: 1024
Multiplication output: 4194304
Put pointer positions: 18446744073709551615
</code></pre>
