Research on putchar, getchar, puts, gets in C language

Insert picture description here
Related blog posts: C++'s get and getline exploration

putchar、getchar

Insert picture description here
Example 1:
Insert picture description here
Example 2: Insert picture description here
Example 3:Insert picture description here

puts

Insert picture description here

Example 4:Insert picture description here

gets

  Gets does not stop typing until it encounters a carriage return, and spaces are also entered as characters , but remember, do not enter characters that exceed the given space size. In the case of not crossing the boundary, gets will automatically append'\0' to the end of the string>

Example 5:
Insert picture description here
Example 6:
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43297891/article/details/112293812