C standard library(c标准库)
<assert.h>: diagnosis
<assert.h> defines only a macro assert with a reference, which is defined as follows:
Void assert (int expression)
The assert macro is used to add diagnostic features to a program, which can test a condition and possibly terminate the program. Execute statement:
Assert (expression);
When the expression is 0, a message is displayed at the terminal:
Assertion failed: 0, file source file name, line line number
Abnormal program termination
Then invoke the abort to terminate the execution of the program.
In <assert.h>, the macro assert is defined as conditional compilation, and if the macro NDEBUG is defined in the source file, the assert macro will be ignored even if the header file <assert.h> is included
<ctype.h>: character class testing
Functions that define test characters are defined in header
file <ctype.h>. In these functions, the arguments for each function are integer int, and each parameter is either EOF or char type. The list of standard functions defined in <ctype.h> is as follows:
Functions defined in <ctype.h>
Function definition
Function brief introduction
Int isalnum (int c)
Check whether the characters are letters or numbers
Int isalpha (int c)
Check if the characters are letters
Int isascii (int c)
Check if the character is ASCII
Int iscntrl (int c)
Check that the character is a control character
Int isDigit (int c)
Check that the characters are numeric characters
Int isgraph (int c)
Check that the characters are printable characters
Int islower (int c)
isalpha 函数Check if the characters are lowercase letters
Int isprint (int c)
Check that the characters are printable characters
Int ispunct (int c)
Check if the characters are punctuation characters
Int isspace (int c)
Check if the character is a space character
Int isupper (int c)
Check if the characters are uppercase letters
Int isxdigit (int c)
Check if the character is a sixteen digit numeric character Int toupper (int c)
Converts lowercase letters to uppercase letters
Int tolower (int c)
Converts uppercase letters to lower case letters
These standard functions defined in <ctype.h>, and some commonly used nonstandard character processing functions, will be described in detail in the Eleventh chapter.
<errno.h>: error handling
Two constants, one variable, are defined in <errno.h>.
1, EDOM
It represents the wrong code for mathematical domain errors.
2, ERANGE
It represents an error code that results out of bounds.
3, errno
This is a variable that is set to indicate the type of error in the system call.
<limits.h>: integer constant
In header file <limits.h>, some constants that represent integer sizes are defined. The following are the expressions and meanings of these constants, as shown in the following
table.
Character constants defined in <limits.h> character constants
Value
Meaning
CHAR_BIT
Eight
Number of char types
CHAR_MAX
255 or 127
Char type maximum
CHAR_MIN
0 or -127
Char type minimum
INT_MIN
-32767
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论