Changing variable name inside a loop
<p>I'm trying to create a loop that will will create a new variable but also change the name of the variable, such as increasing in value, automatically. Not sure if this is possible because you cant have dynamic variables?</p>

<pre><code>if (cin.get() == '\n')
{
    m ++; // Add an integer to m
    string (1 + m); //Trying to name the string the value of m + 1, i.e 3
    cin.ignore():
    getline(cin, (1 + m))
    myfile &lt;&lt; (1 + m) &lt;&lt; endl;
}
</code></pre>

<p>That is my current code which is full of errors but hopefully readable enough to gain an understanding of what I'm trying to do. </p>

<p>Bad title, don't know what else to call it.</p>