I. Origins of errnoIn C Programming, errno is an indispensable variable, especially in network programming. If you have never used errno, it only means that your program is not robust enough. Of course, if you are using getlasterror () on the Win32
There are three types of error reporting usages in the C language standard library.1, errnoerrno is defined in the header file as follows
#ifndef errno
extern int errno;
#endif
An external variable errno an implementation-defined
Errno (Error Report) usage in C language, errno Error Report
There are three forms of error reporting in the C language standard library.
1,Errno
Errno is defined in the header file, as follows:
#ifndef errnoextern int errno;#endif
The external
first, the origin of errnoIn C programming, errno is an indispensable variable, especially in network programming. If you have not used errno, it can only indicate that your program is not strong enough. Of course, if you are the GetLastError () of
Ifndef _i386_errno_h#define _i386_errno_h#define EPERM 1/* Operation not permitted * *#define ENOENT 2/* No such file or directory */#define ESRCH 3/* No such process * *#define EINTR 4/* Interrupted system call * *#define EIO 5 */I/O error *
1. Relationship between printf and fprintf 1 printf ()# Include Int printf (const char * format ,...);The printf () function prints the output to stdout (standard output) and other parameters according to the format given by format. For the output
The errno module defines some symbolic error codes, such as enoent ("not Found") and Eperm ("No Permissions").
If you need to distinguish between different error codes, you can use the symbol name.
In Py2, the IOError exception provides a tuple
When the C API function in Linux exception, the errno variable (need include errno.h) is usually assigned an integer value, different values represent different meanings, you can see the reason for this value speculation, in the actual programming
C There are three forms of error reporting usage in the Language standard library. 1 , errnoerrno in the The header file is defined in the following#ifndef Errnoextern int errno; #endif external variable errno implementation-defined error
To do python development, you frequently encounter the following errors when manipulating files under Windows:
IOError: [Errno N]
n is the error number, as frequently encountered IOError: [Errno 2], ioerror: [Errno 5], ioerror: [Errno 13] ...
Here
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.