cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
to get data type
to get data type
May 19, 2011 at 9:32am UTC
gautam jha
(2)
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.
May 19, 2011 at 9:39am UTC
quirkyusername
(792)
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.
May 19, 2011 at 10:29am UTC
Moschops
(7244)
http://www.cplusplus.com/reference/std/typeinfo/type_info/
Jun 2, 2011 at 2:20am UTC
CrazyBoy
(1)
use Library Function : typeid(variable name).name()
Jun 2, 2011 at 3:24pm UTC
ne555
(10692)
Agreed with quirkyusername.
Besides, you still know the type of a
void
*
, it is of type
void
*
Topic archived. No new replies allowed.