title: Using unique dynamic variable names (not variable values!)
body: <p>Ok so, this is more a sanity check than anything else.</p>
  
  <p>Lets asume we have a struct called lua_State, now I need to create a uncertain amount of unique lua_State's. To make sure I don't use the same variable name twice I would need to have some sort of way to get an unique variable every time i make a new state.</p>
  
  <p>However there is only one way (I think?) to create a new state, and that is as follows:</p>
  
  <pre><code>lua_State *S = lewL_newstate();
  </code></pre>
  
  <p>Now I would need some way to dynamically change that "S" to.. whatever.</p>
  
  <p>For example: If I had 4 lua files, and I wanted to load each into their own lua_State, I would call: lua_State *A = lewL_newstate(); for the first, lua_State *B = lewL_newstate(); for the second, and so on. Keep in mind the number of lua files varies so creating a fixed number of states probably won't go over well.</p>
  
  <p>How would I go about doing this?</p>
  
  <p>clarification:</p>
  
  <p>.h</p>
  
  <pre><code>struct lua_State
  </code></pre>
  
  <p>.cpp</p>
  
  <pre><code>createNewState(Lua_State* something){
   lua_State* something = luaL_newstate();
  }
  </code></pre>
  
  <p>I thought about creating a </p>
  
  <pre><code>std::map&lt;int, lua_State*&gt; luaMap;
  </code></pre>
  
  <p>but then I would still have the problem of actually generating (for lack of better words) a variable name for every int-index.</p>
  
  <p>So, have I been drinking too much coffee and is there a glaringly obvious simply solution to what I am trying to do, or should I just stop coding untill the crazy blows over?</p>
  
  <p>Thanks in advance.</p>