title: Split command line argument into arguments/a vector using C++
body: <p>I have a C++ project that was previously receiving multiple command line arguments with code like so:</p>
  
  <pre><code>int main(int argc, char *argv[]) {
  
    for (int i = 1; i &lt; 4; i = i + 1) {
      // do some stuff with argv[i]
      int in_arg = m[argv[i]];
    }
  
    return 0
  }
  </code></pre>
  
  <p>Using this code, an example command line argument might be:</p>
  
  <pre><code>C:\MyFolder\MyExecutable.exe 4 0 1
  </code></pre>
  
  <p>However, due to plugging this code into a wider project my command line will now have to look like this instead: </p>
  
  <pre><code>C:\MyFolder\MyExecutable.exe 401
  </code></pre>
  
  <p>How can I split the argument <code>401</code> into a vector or similar that is functionally the same as having three input arguments like <code>4 0 1</code> so that my line: </p>
  
  <pre><code>int in_arg = argv[i];
  </code></pre>
  
  <p>...could be repointed to something like:</p>
  
  <pre><code>int in_arg = new_vector[i];
  </code></pre>
  
  <p>I only dabble with C++, so apologies if I am asking basic questions.</p>
  
  <p>Thanks</p>