To answer the topic title more directly, you cannot check if an integer is null, because an integer is never null :)
(The worst you can get in C/etc is 'undefined', not the same thing)
(The worst you can get in C/etc is 'undefined', not the same thing)