David List
2003-08-08 15:17:28 UTC
I am trying to use some code, that should yield the type name of a
given variable. There is an example in Stroustrup, section 15.4.4,
page 415.
I get only the first character of the type name, however. Can anyone
pinpoint my problem?
An example of my usage is:
----------main.cpp----------
#include <iostream>
#include <typeinfo>
using namespace std;
int main()
{
int a = 0;
cout << "typename of a is " << typeid(a).name() << endl;
}
----------main.cpp----------
This program produces a line of text, that says:
typename of a is i
given variable. There is an example in Stroustrup, section 15.4.4,
page 415.
I get only the first character of the type name, however. Can anyone
pinpoint my problem?
An example of my usage is:
----------main.cpp----------
#include <iostream>
#include <typeinfo>
using namespace std;
int main()
{
int a = 0;
cout << "typename of a is " << typeid(a).name() << endl;
}
----------main.cpp----------
This program produces a line of text, that says:
typename of a is i
--
Med venlig hilsen / Best regards
David List
Med venlig hilsen / Best regards
David List