Home>Article>Backend Development> Does the C language itself have no input and output statements?
correct. The C language program library contains two functions, printf and scanf. When the user needs input and output, these two functions must be entered. The C language program library calls these two functions during compilation, so the C language itself cannot be input. output.
The operating environment of this tutorial: windows7 system, c99 version, Dell G3 computer.
The c language itself has no input and output statements.
Different from other computer programming languages, most functions in C language are implemented through function calls, so the number of statements in C language itself is small. The C language adopts a method that makes the expansion of language functions very convenient. If you need to add new functions, you only need to add the corresponding functions in the function library; and if the function of a function needs to be adjusted, you only need to modify the code of the function itself, but you do not need to modify other programs that call the function. .
The functions in the C language are called system functions. Users can directly call these functions to complete the corresponding functions. For example, printf, fabs, etc. are all system functions. System functions are stored in system files called "C function libraries". When a function needs to be used, the system should be notified of the function library where the function is located. This is achieved by including a header file. For example, the basic framework of the C program shown below:
#include "stdio.h" #include "conio.h" int main(void) { /* 此处添加你自己的代码 */ getch(); return 0; }
#include "stdio.h"
The preprocessing statement is to notify the system to include the stdio.h header file into this program file, so that you can use the system functions that have been defined in it.
The basic input function in C language is realized by using the function scanf, and the basic output function is realized by using the function printf. The header files of these two functions arestdio.h
, but since these are two very commonly used functions, the C language stipulates that the corresponding#include# can be omitted when using these two functions. ##Order.
Introduction to Programming! !
The above is the detailed content of Does the C language itself have no input and output statements?. For more information, please follow other related articles on the PHP Chinese website!