c++ 라이브러리에서는 <limit.h> 또는 < climits> 를 통해서 정수의 형식에 대한 정보를 사용할 수 있다.
공식 문서 -> https://cplusplus.com/reference/climits/
https://cplusplus.com/reference/climits/
MB_LEN_MAXMaximum number of bytes in a multibyte character, for any locale1 or greater*
cplusplus.com
꼭 헤더파일 선언 해줘야한다.
#include <climits>
CHAR_MIN | Minimum value for an object of type char | either SCHAR_MIN or 0 |
CHAR_MAX | Maximum value for an object of type char | either SCHAR_MAX or UCHAR_MAX |
INT_MIN | Minimum value for an object of type int | -32767 (-215+1) or less* |
INT_MAX | Maximum value for an object of type int | 32767 (215-1) or greater* |
LONG_MIN | Minimum value for an object of type long int | -2147483647 (-231+1) or less* |
LONG_MAX | Maximum value for an object of type long int | 2147483647 (231-1) or greater* |
LLONG_MIN | Minimum value for an object of type long long int | -9223372036854775807 (-263+1) or less* |
LLONG_MAX | Maximum value for an object of type long long int | 9223372036854775807 (263-1) or greater* |