Search code examples
ctypesconstantssigned-integer

C - Get smallest possible signed integer


Is there anything similar to Java's Integer.MIN_VALUE in C, which gives the smallest possible value of a signed integer, or do I just have to hard code the value myself?


Solution

  • You can use limits.h http://en.cppreference.com/w/c/types/limits

    I think this is what you're looking for: INT_MIN = minimum value for an int