fueanta

Getting Data Types of variables.

Oct 5th, 2016
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "iostream"
  2. #include "typeinfo"
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8.     float* ptr, data;
  9.  
  10.     cout << typeid(data).name() << endl; // f-> float
  11.     cout << typeid(ptr).name() << endl; // pf-> pointer to float
  12.  
  13.     return 0;
  14. }
RAW Paste Data