Implementing a type cast
<p>so I'm having trouble figuring out where I should be implementing the type cast for my code. I understand the purpose of type casting, but I just don't get (or am over thinking) where exactly it should go for my given situation. </p>

<p>So I have a function. It's going to take the input and print it out in hexadecimal form. </p>

<pre><code>void PrintHex(int InNum)
{
cout &lt;&lt; hex &lt;&lt; setiosflags (ios_base::showbase) &lt;&lt; InNum;
};
</code></pre>

<p>The thing is, it's not going to be receiving an int as expected, but rather a float from a member function of my class. </p>

<pre><code>float Sphere::CalcCircumference()
{
return (Pi * (Radius*2));
};
</code></pre>

<p>I need to type cast the float to an int to avoid a loss of precision. But exactly where do I do this? I get a feeling I might need to do it in the member function that determines the Circumference, returning the outcome in static form. But I'm not sure.</p>
