J
John Smith
Hey folks,
I know this is an old topic, but I can't find a definitive answer on google.
How do I tell if an int has been initialized or not? I had been testing it
like:
if(myInt == Convert.ToInt32(null)){
:
}
But now I just realized that this is true:
Convert.ToInt32(null) == Convert.ToInt32(0)
and since myInt may contain 0 as a value, this won't work. So, how do you
do it? I'm starting to miss the simple good old days of
if(myInt == null)
I know this is an old topic, but I can't find a definitive answer on google.
How do I tell if an int has been initialized or not? I had been testing it
like:
if(myInt == Convert.ToInt32(null)){
:
}
But now I just realized that this is true:
Convert.ToInt32(null) == Convert.ToInt32(0)
and since myInt may contain 0 as a value, this won't work. So, how do you
do it? I'm starting to miss the simple good old days of
if(myInt == null)