how to get the datatype of object cpp code example
Example 1: cpp get data type
#include <typeinfo>
...
cout << typeid(variable).name() << endl;
Example 2: c++ get data type
// Example
std::cout << "Data-type = " << typeid(YourVariable).name() << "\n";
// Syntax
typeid(YourVariable).name()