About typeid function in C++
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/789402/typeid-returns-extra-characters-in-g">typeid() returns extra characters in g++</a>  </p>
</blockquote>



<p>I learned from  <a href="http://www.cplusplus.com/reference/typeinfo/type_info/" rel="nofollow">cplusplus.com</a> that <strong><em>typeid</em></strong> function can get variable's type infomation in C++. But the result is a bit strange in my machine.</p>

<p>For example:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;typeinfo&gt;
#include &lt;vector&gt;
using namespace std;

class Test
{
};
int main()
{
    vector&lt;int&gt; v;
    vector&lt;vector&lt;int&gt; &gt; v2;
    Test t;
    cout&lt;&lt;"typeid for class Test: "&lt;&lt;typeid(t).name()&lt;&lt;endl;
    cout&lt;&lt;"typeid for vector&lt;int&gt;: "&lt;&lt;typeid(v).name()&lt;&lt;endl;
    cout&lt;&lt;"typeid for vector&lt;vector&lt;&lt;int&gt; &gt;: "&lt;&lt;typeid(v2).name()&lt;&lt;endl;
    return 0;
}
</code></pre>

<p>After running this code, the output in my machine is:</p>

<pre><code>typeid for class Test: 4Test
typeid for vector&lt;int&gt;: St6vectorIiSaIiEE
typeid for vector&lt;vector&lt;&lt;int&gt; &gt;: St6vectorIS_IiSaIiEESaIS1_EE
</code></pre>

<p>I'm quite confused with the "4" before the class "Test" and the strange letters around the vector. Can anybody give me some explanations? Thank you!</p>

<p>My operating system is Fefora 17, g++ (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5)</p>
