Declaring a data type dynamically in C++
<p>I want to be able to do the following:</p>

<p>I have an array of strings that contain data types:</p>

<pre><code>string DataTypeValues[20] = {"char", "unsigned char", "short", "int"};
</code></pre>

<p>Then later, I would like to create a variable of one of the data types at runtime.  I won't know at compile time what the correct data type should be.</p>

<p>So for example, if at runtime I determined a variable x needed to be of type int:</p>

<pre><code>DataTypeValues[3] x = 100;
</code></pre>

<p>Obviously this won't work, so how could I do something like this?</p>
