Answers for "type of a variable in c++"

C++
2

check variable type c++

if (typeid(variable) == typeid(std::string)) {
		std::cout << variable << " is a string" << std::endl;
	}
	else {
		std::cout << variable << " is not a string" << std::endl;
	}//you can do this for every type
Posted by: Guest on August-11-2021
0

c++ variable type

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

define type c++

typedef unsigned int u_int; //giving 'unsigned int' a name of u_int
Posted by: Guest on November-29-2020

Code answers related to "type of a variable in c++"

Browse Popular Code Answers by Language