C++ resolving istream::tellg warning
<p>Warning:</p>

<pre><code>warning C4244: 'initializing' : conversion from 'std::streamoff' to 'unsigned int', possible loss of data
</code></pre>

<p>Caused by:</p>

<pre><code>unsigned int FileSize = File.tellg( ); // WARNING
std::cout &lt;&lt; "Size = " &lt;&lt; FileSize &lt;&lt; std::endl;
</code></pre>

<p>Possible solution?
Is it okay to do this:</p>

<pre><code>// No more warnings but, is it safe?
unsigned int FileSize = (unsigned int)File.tellg( ); // OK?
std::cout &lt;&lt; "Size = " &lt;&lt; FileSize &lt;&lt; std::endl;
</code></pre>

<p>How about this?</p>

<pre><code>// No more warnings but, is it safe?
unsigned int FileSize = static_cast&lt; unsigned int &gt;( File.tellg( ) );
</code></pre>
