Is there any way to create a class instance name by a string taken as user input? : <p>In C++, I want to create a class instance which name will be a string taken as input.</p>

<p>Consider the following code segment.</p>

<pre><code>class my_class{
   int a;
};

int main()
{
   string name;
   getline(cin, name); //let the input "tom"

   my_class name; // expecting an instance of my_class named as tom
}
</code></pre>

<p>As it should, I am getting error. Is there any way to do it.</p>
