Link to home
Start Free TrialLog in
Avatar of consultkp
consultkp

asked on

checking data in int and long variables? urgent !...

hello experts,

I want to check wether an "int" variable has any data or not.

but if I do like this -
int a;
---
---
 if(a == null){
       -----
}


then it is saying that operator == is not defined for int and null.

is the default value of int and long variables are 0 ? if so can I do like this if( a == 0) then does it mean that it has no data ?

so please suggest me how to check whether an int or a long variable has any data or not ?

thank you .
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(The same goes for long)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of consultkp
consultkp

ASKER

thanks a lot for answering , and also understanding what I mean with "urgent", thank you I am continuing with my work, have nice time over there.
babaii
kiran.
:-)
glad to help