C++ get each digit in int
<p>I have an integer:</p>

<pre><code>int iNums = 12476;
</code></pre>

<p>And now I want to get each digit from iNums as integer. Something like:</p>

<pre><code>foreach(iNum in iNums){
   printf("%i-", iNum);
}
</code></pre>

<p>So the output would be: "1-2-4-7-6-".
But i actually need each digit as int not as char.</p>

<p>Thanks for help.</p>
