C Language library function one __ function

Source: Internet
Author: User

Because the C language itself can be said to be a very lightweight programming language, the language itself provides very limited content, of course, this also contributed to the flexible and compact characteristics. C language has a large part of the characteristics are not implemented through the language, but through the library function to achieve, if not using the library function can almost not write any of the available C language programs. The library function provided by the official C language is called the standard library function. The standard library functions implement most of the functions we need, and these functions can be roughly divided into I/O processing, characters and strings, mathematical functions, time and date, memory management and other miscellaneous functions, as well as a bit of implementation of the library function does not limit the means of implementation. Everyone can implement their own functions and then use it as a library function, but only such functions are personal library functions, not the standard library functions.

Here is a standard library function to handle I/O. I/O processing is a common topic in programming, in computer terminology, I/O processing refers to the CPU and peripheral interaction is called I/O processing, such I/O includes the number from memory, reading the mouse keyboard instructions. I/O attention here refers to the operating system level of I/O interaction is the main object of computer memory, disk file read write and standard input and output. Below is a superficial explanation of Linux I/O processing mode.

In a Linux system, I/O is represented in the form of a stream. Without running a shell command, the 3 standard file descriptors were opened by default, standard input, standard output, and standard error output. On the file descriptor we can do the corresponding file I/O operation. So when I/O is used in C, the first operation we do is to open the file, we can get a file descriptor after we open the file, and we can do I/O to the file through the file descriptor. This is the basic principle of I/O operation in C language.

Here is an example to illustrate the basic I/O operation of C language.

Added later

In summary, I/O operations involve file operations. Files are managed on the Linux system on the stream, C language through the operation flow to achieve file I/O operation.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.