Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #variable #type
ADD COMMENT
Topic
Name
4+8 =