Answers for "how to get data type for any variable in c++"

C++
6

how to check datatype of a variable in c++

#include <typeinfo>
...
cout << typeid(variable).name() << endl;
Posted by: Guest on May-29-2020
0

c++ get data type

// Example
std::cout << "Data-type = " << typeid(YourVariable).name() << "\n";
  
// Syntax
typeid(YourVariable).name()
Posted by: Guest on May-05-2021

Code answers related to "how to get data type for any variable in c++"

Browse Popular Code Answers by Language