How will i know in C programming if an integer is negative or positive?
If an integer is positive or negative
Collapse
X
-
Tags: None
-
This is only true if signed integers are encoded using two's-complement. Although two's-complement is ubiquitous, it is not mandated by the C Standard. This approach is not portable.Originally posted by jkmyoung... the first bit of the integer will be set if it is negative. If it is not set, the number is non-negative ...Comment
Comment