Could someone please tell what the maximum and minimum values are for both type int and float (easy question I know but I can't find a reference to it anywhere).
Also, are INT_MAX and INT_MIN the equivalents?
Could someone please tell what the maximum and minimum values are for both type int and float (easy question I know but I can't find a reference to it anywhere).
Also, are INT_MAX and INT_MIN the equivalents?
Names defined in <limits.h> specifying the limits on the reanges of integral types.
---Type Name----|----Min Value------|------Max Value--
================|===================|============= ====
signed char----|----SCHAR_MIN------|-----SCHAR_MAX---
unsigned char--|---------0---------|-----UHAR_MAX----
char-----------|----CHAR_MIN-------|-----CHAR_MAX----
short----------|----SHRT_MIN-------|-----SHRT_MAX----
unsigned short-|---------0---------|-----USHRT_MAX---
int------------|----INT_MIN--------|-----INT_MAX-----
unsigned int---|---------0---------|-----UINT_MAX----
long-----------|----LONG_MIN-------|-----LONG_MAX----
unsigned long--|---------0---------|-----ULONG_MAX---
now just print these with there format specifiers for example
printf("signed char\nMAX: %c \nMIN: %c \n", SCHAR_MAX, SCHAR_MIN);
these are the min and max value for your computer, (they are normally similar on most or all computers)
Theres a neater attachement of the table
kwigibo