title: C++ Assigning variables with 'compound names' using an external argument
body: <p>I'm trying to read a .pdb file and hence I'm ending with a lot of variables in my code. In an effort to reduce them (and avoid Segmentation fault errors) I was wondering if I could assign array names in my code using an external argument.</p>
  
  <p>The starting bit of my code foo.cpp looks like this-</p>
  
  <pre><code>/*All the relevant headers*/
  using namespace std ;
  int main(int argc, char *argv[])
  {
      ifstream input(argv[1],ios::out) ;
      string first(argv[2]) ;
      string second(argv[3]) ;
      string "first"ATOM[1000] ;
      string "second"ATOM[1000] ;
  }
  </code></pre>
  
  <p>And I'm hoping that if I launch the program as ./foo.exe input C O, I want two arrays called CATOM and OATOM to be initialised.</p>
  
  <p>If there is no second argument then the OATOM array should not get defined.</p>
  
  <p>This would save me the trouble of having to make multiple arrays such as NATOM[1000], OATOM[1000] etc. since I can define them <strong>within</strong> the program.</p>
  
  <p>Is this possible? For each 'O', 'C', 'N' etc there need to be about 8-10 long string arrays which is causing it to blow up.</p>
  
  <p>I'm new to programming and I hope this question makes sense.
  Thanks in advance!</p>