English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C Language Basic Tutorial

C Language Flow Control

C Language Functions

C Language Arrays

C Language Pointers

C Language Strings

C Language Structure

C Language File

C Other

C Language Reference Manual

C Standard Library <errno.h>

C Standard Library errno.h The header file defines an integer variable errnowhich is set through system calls, certain library functions in error events indicate what went wrong. This macro expands to a modifiable lvalue of type int, so it can be read and modified by a program.

At program startup,errno Set to zero, the specific functions in the C standard library modify its value to some non-zero value to indicate certain types of errors. You can also modify its value or reset it to zero at an appropriate time.

errno.h The header file defines a series of macros representing different error codes, which should be expanded to a type of int integer constant expression.

Library Macro

The following lists the macros defined in the header file errno.h:

Serial NumberMacro & Description
1extern int errno
This is a macro set by system call, indicating what went wrong in some library functions during error events.
2EDOM Domain Error
This macro indicates a domain error, which occurs when the input parameter is outside the domain defined by the mathematical function, and errno is set to EDOM.
3ERANGE Range Error
This macro indicates a range error, which occurs when the input parameter is outside the range defined by the mathematical function, and errno is set to ERANGE.