Example:
![typeid(expression) typeid(expression)](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8HqRlhNEWZo6g7Gjqr8fomj32aypGP7dWuSYlEbQhU1G313yg0znhHFAQNY0sQnRj5VxtnbqckBMWXgRnzDcJqTsC3jWHrhNpQWDeyGJi1_WaUDpgu157_iXmCwi4nuNMZ4cksFC3x-A/s400/typeid.png)
// ConsoleApplication1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout << "typeid(): " << endl << endl; cout << "typeid(0.1234): " << typeid(0.1234).name() << endl; cout << "typeid(45): " << typeid(45).name() << endl; cout << "typeid(0.1234 * 45): " << typeid(0.1234 * 45).name() << endl; short shortArray[4]; cout << "typeid(shortArray): " << typeid(shortArray).name() << endl; cout << "typeid(\"Hello\"): " << typeid("Hello").name() << endl; cout << "typeid(true): " << typeid(true).name() << endl; system("PAUSE"); return 0; }
No comments:
Post a Comment