title: Parsing user entered int into digits not working C++
body: <pre><code>vector&lt;int&gt; vec(unsigned int n)
  {     
    vector&lt;int&gt; num;
    while (n != 0)
    {
      num.push_back(n%10);
      vec(n / 10);
    }
    return num;
  }
  </code></pre>
  
  <p>This is a function to parse a user entered int into digits. I'm making a recursive call to the function which returns a vector. I check till the value of the number becomes zero. But when I run it, it's entering into a infinite loop.</p>
  
  <p>What can be the problem?</p>