当前位置:网站首页>[embedded C foundation] Part 6: super detailed explanation of common input and output functions

[embedded C foundation] Part 6: super detailed explanation of common input and output functions

2022-07-28 13:01:00 Black cat senior

stdio.h Standard I / O library

putchar Output a character... To the terminal
getchar Get a character from the terminal

printf Output the format string to the terminal
scanf Read the format string from the terminal

puts Output a string to the terminal
gets Read a string from the terminal

1 putchar

int putchar (int ch);
Parameters :ch For the character to be output , The character is represented by its corresponding int Value for delivery .
Return value : Output success , Returns the ASCII Code value , Otherwise return to EOF.
function : Output a character... To the terminal
characteristic :1. Characters are output to the terminal
2. Output a character

Example 1:
 Insert picture description here
Execution results :
 Insert picture description here
Example 2:

#include <stdio.h>

int main
原网站

版权声明
本文为[Black cat senior]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207281153085990.html