to get data type

suppose I have some variable name and I don't know its data type how I will know its data type. And if I have two variable names then how I will compare if their data type is same or not.
in what situation would you not know an object's data type? Other than passing a void* and there are few situations which warrant that.
use Library Function : typeid(variable name).name()
Agreed with quirkyusername.
Besides, you still know the type of a void *, it is of type void *
Topic archived. No new replies allowed.