[Dev-C++] How to test type of variable?? Newb question
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Chris I. <chr...@li...> - 2005-11-03 21:57:08
|
Hello all.... 1st post here
I was hoping someone could tell me how you test the datatype of a
variable in C++?
Like if I declare
struct ELEMENT{int key;} variable1;
OR
int variable2 = 10;
How can I type check variable1 or variable2?
I mostly write in Python and I'm looking for something like
type(variable1) #would return the datatype of variable1
or
isinstance(variable2, int) #would return true is variable2 is a
instance of the int class
Thanks in advance,
Chris
|