I
Irish
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... I'm looking for something similar to
python's way to do it... if there is in C++
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
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... I'm looking for something similar to
python's way to do it... if there is in C++
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