limits.h in C
limits.h in C
The file header named limits.h in Library C defines the various attributes of different variable types. Macros, defined in this header, limit the value of various variable types such as char, int, and long.
These limits determine that a variable cannot contain any value that exceeds those limits, for example, an unsigned char can hold a maximum value of 255.
The macros are defined in limits.h
The following values are separate implementers and are defined with #define directives, but these values cannot be lowercase.
Macro Value Description CHAR_BIT 8 Defines the number of bits in a byte SCHAR_MIN -128 Definition of the minimum value for a signed char SCHAR_MAX 127 Maximum value definition for a signed char UCHAR_MAX 255 Defines the maximum value for an unsigned char CHAR_MIN 0 Define the smallest value for a char type and its value is equal to SCHAR_MIN if char represents negative values, otherwise 0 CHAR_MAX 127 Defines the minimum value for a char type and its value is equals SCHAR_MAX if char represents negative values, otherwise UCHAR_MAX MB_LEN_MAX 1 Defines the maximum number of bytes in a multi-byte char (character represented by multiple bytes) SHRT_MIN -32768 Defines the minimum value for a short int SHRT_MAX +32767 Maximum value definition for a USHRT_MAX 65535 short int Definition maximum value for an unsigned short int INT_MIN -32768 Define the minimum value for an INT_MAX int +32767 Define the maximum value for an int UINT_MAX 65535 Define the maximum value for an unsigned int LONG_MIN -2147483648 Definition minimum value for a long int LONG_MAX +2147483647 Defining the maximum value for a long int ULONG_MAX 4294967295 Defining the maximum value for an unsigned long intFor example
The following C program illustrates the usage of some constants defined in limits.h.
#include #include int main () { printf ( "So bit de bieu dien mot byte la %dn" , CHAR_BIT ); printf ( "Gia tri nho nhat cua SIGNED CHAR = %dn" , SCHAR_MIN ); printf ( "Gia tri lon nhat cua SIGNED CHAR = %dn" , SCHAR_MAX ); printf ( "Gia tri lon nhat cua UNSIGNED CHAR = %dn" , UCHAR_MAX ); printf ( "Gia tri nho nhat cua SHORT INT = %dn" , SHRT_MIN ); printf ( "Gia tri lon nhat cua SHORT INT = %dn" , SHRT_MAX ); printf ( "Gia tri nho nhat cua INT = %dn" , INT_MIN ); printf ( "Gia tri lon nhat cua INT = %dn" , INT_MAX ); printf ( "Gia tri nho nhat cua CHAR = %dn" , CHAR_MIN ); printf ( "Gia tri lon nhat cua CHAR = %dn" , CHAR_MAX ); printf ( "Gia tri nho nhat cua LONG = %ldn" , LONG_MIN ); printf ( "Gia tri lon nhat cua LONG = %ldn" , LONG_MAX ); return ( 0 ); }
Compiling and running the above C program will result:
According to Tutorialspoint
Last lesson: float.h in C
Next article: locale.h in C
5 ★ | 4 Vote
You should read it
May be interested
- Check out the 'buffalo' Pokémon in Pokémon Goeach type of pokemon has hp, cp, ability to attack and endure differently. based on these indicators, players can determine as well as choosing the most powerful pokemon for their offensive tactics.
- Sitting home can also locate Pokemon around, do you believe it?the tightening of the niantic developers' rules to prevent players from abusing the support tools also brings annoyance, such as those who have no conditions to move much, go away, it is hard to know. get the location of the pokemon around the area they live in
- 5 undeniable benefits when playing Pokemon Goget to know many new people, breathe fresh air, relieve stress, increase concentration thanks to going out for a walk .... are compelling reasons to force you to try pokemon go now .
- Want to earn the fastest Pokécoins in Pokémon Go? So don't miss this article!pokécoins in pokémon go play the role of buying items in the store. the more coins you earn, the more likely you are to buy more items. to earn pokécoins, players will have to complete certain tasks or buy real money.
- Pokémon systems when fighting in Pokémon Goeach pokémon system in pokémon go has different strengths, along with a specific weakness. this type of pokémon will have the power to attack the other pokémon, but can defeat the other pokémon. if you know the characteristics of each type, it will be easier to choose which pokémon to battle.
- The terms you need to know when playing Pokémon Gopokémon go is the most prominent name in recent days. this game of capturing and training virtual animals has created a relatively new way of playing, as players have to constantly move to catch pokémon. during the process of joining pokémon go, you will encounter and use a lot of important terms. so what do they mean?
- How to play Pokemon GO on Windows computersrecently, pokemon go has become a popular game, attracting thousands of gamers around the world. in previous posts network administrator has guided you on how to play pokemon go on android devices and ios devices. in the article below, network administrator will guide you how to play pokemon go on windows computers using bluestacks emulator software.
- How to become a good Pokémon Go hunter?with a new way of playing, pokémon go has created a new phenomenon in the game village around the world. players will have to go around and find pokémon for themselves. so how to quickly catch pokémon and in large numbers?
- Things to know to upgrade Pokémon in Pokémon Gothe whirlwind pokémon go has spread its power right on the first day of its release. everyone rushed to the street to find a pokémon for themselves. therefore, in order to become a pokémon hunter, you need to master the basics of participating in pokémon go battlefield.
- List of medals received in Pokemon Goin addition to getting items when leveling up, gamers who join pokemon go also have the opportunity to receive their proud achievements.