File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 11#include < iostream>
22#include < typeinfo>
33#include < string>
4+ #include < vector>
45
56using namespace std ;
67
@@ -12,15 +13,21 @@ int main()
1213 int * i3, i4; // i3 will be treated as pointer, but i4 not
1314 float f1;
1415 double d1;
15- std::string s1;
16+ string s1;
17+ vector<int > vi;
18+ vector<vector<int >> vvi;
19+ vector<string> vs;
1620
17- cout << typeid (i1).name () << endl; // Pi
18- cout << typeid (i2).name () << endl; // Pi
19- cout << typeid (i3).name () << endl; // Pi
20- cout << typeid (i4).name () << endl; // i
21- cout << typeid (f1).name () << endl; // f
22- cout << typeid (d1).name () << endl; // d
23- cout << typeid (s1).name () << endl; // NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
21+ cout << typeid (i1).name () << endl; // Pi
22+ cout << typeid (i2).name () << endl; // Pi
23+ cout << typeid (i3).name () << endl; // Pi
24+ cout << typeid (i4).name () << endl; // i
25+ cout << typeid (f1).name () << endl; // f
26+ cout << typeid (d1).name () << endl; // d
27+ cout << typeid (s1).name () << endl; // NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
28+ cout << typeid (vi).name () << endl; // St6vectorIiSaIiEE
29+ cout << typeid (vvi).name () << endl; // St6vectorIS_IiSaIiEESaIS1_EE
30+ cout << typeid (vs).name () << endl; // St6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE
2431
2532 return 0 ;
2633}
You can’t perform that action at this time.
0 commit comments