title: Split an integer number into digits non-backward
body: <p>I am looking for an efficient and simple way to separate an integer into digits, but I need to separate them starting from the first one.</p>
  
  <p>Here's the typical way to sepparate a number into digits:</p>
  
  <pre><code>int main(int argc, char* argv[]) { //argc is going to be the number
      while(argc != 0) {
          cout &lt;&lt; argc % 10 &lt;&lt; endl;
          argc /= 10;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>But doing it this way I will obtain, for example, 5437 -> 7,3,4,5
  I want to reverse the order of appereance, 5,4,3,7. So I created this:</p>
  
  <pre><code>int main(int argc, char* argv[]) {
      int rem = 1;
  
      while(argc / rem &gt; 10) //We increase the remainder until we get the same amount of digits than the number
          rem *= 10;
  
      while(argc != 0) {
          cout &lt;&lt; argc / rem &lt;&lt; endl; //We take the cocient of the division, wich will be always the first digit
          argc %= rem; //Now we discard that digit
          rem /= 10; //And we decrease the number of digits of the remainder too
      }
  
      return 0;
  }
  </code></pre>
  
  <p>The thing is: is there any alternative way to do this in a shorter/simpler way?</p>
  
  <p>PS: I can't use stacks, lists or that kind of structures.</p>
  
  <p>Thanks in advance</p>