fork download
  1. #include <iostream>
  2. #include <typeinfo>
  3. using namespace std;
  4.  
  5. template<class T>
  6. void printType(const T &value) {
  7. cout << typeid(value).name() << endl;
  8. }
  9.  
  10. int main() {
  11. int a[3];
  12. int *b = new int[3];
  13.  
  14. ::printType(a);
  15. ::printType(b);
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
A3_i
Pi