title: How do I make a command line argument into a vector with each character as a different value?
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  using namespace std;
  /*
  void square(cLine, height){
  
  }
  */
  //void insertVector(vector&lt;char&gt; &amp; cLine, )
  int main(int argc, char *argv[]){
      if (argc != 5){
          cerr &lt;&lt; "Incorrect number of arguments" &lt;&lt; endl;
          return 1;
      }
      ofstream writeFile(argv[4]);
      if (!writeFile.good()){
          cerr &lt;&lt; "Bad file, could not open" &lt;&lt; endl;
          return 1;
      }
      int arrayLength = sizeof(argv[1]);
      vector&lt;string&gt; cLine;
      string cString(argv[1]);
      for(int i=0,i&lt;arrayLength-2,++i){
          cLine.push_back(cString.substr(i,i+1));
      }
      cout &lt;&lt; cLine &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I'm trying to take an argument argv[1] and make it into a vector so I can easily splice it later on, I understand the argument is a c style char* array but I don't how to convert it into a vector where each index is exactly a character, yet is printable to console.</p>