当前位置:网站首页>C language ---getchar() and putchar()
C language ---getchar() and putchar()
2022-06-26 13:54:00 【cxxbb】
putchar() and getchar() Are used for input and output of characters
putchar()-- Output a character
getchar()-- Read characters from the cache , Call once getchar() Just read one character
When the program calls getchar() when , The program waits for the user to enter characters from the keyboard , The input character will be put into the buffer first , Wait until the user presses enter , Press each getchar() and scanf() Assign a character value in the order of .
#include<stdio.h>
int main()
{
char B0,B1,B2;
printf("press a key and then press enter:");
B0=getchar();
scanf("%c",&B1);
B2=getchar();
printf("%c",B1);
putchar(B2);
putchar(B0);
return 0;
}
Results, :
press a key and then press enter:FGH
GHF
边栏推荐
- Awk tools
- 免费的机器学习数据集网站(6300+数据集)
- 嵌入式virlog代码运行流程
- 创建一个自己的跨域代理服务器
- Is it safe to open a securities account? Is there any danger
- Wechat applet -picker component is repackaged and the disabled attribute is added -- below
- On insect classes and objects
- Network remote access using raspberry pie
- GC is not used in D
- 团队管理的最关键因素
猜你喜欢

7.consul service registration and discovery

Detailed sorting of HW blue team traceability process

Ring queue PHP

输入文本自动生成图像,太好玩了!

8.Ribbon负载均衡服务调用

Use performance to see what the browser is doing

Detailed introduction to shell script (4)

Create your own cross domain proxy server

Mongodb series window environment deployment configuration

hands-on-data-analysis 第三单元 模型搭建和评估
随机推荐
Here Document免交互及Expect自动化交互
团队管理的最关键因素
Hands on data analysis unit 3 model building and evaluation
创建一个自己的跨域代理服务器
Select tag - uses the default text as a placeholder prompt but is not considered a valid value
Is it safe to open a securities account? Is there any danger
输入文本自动生成图像,太好玩了!
KITTI Tracking dataset whose format is letf_ top_ right_ bottom to JDE normalied xc_ yc_ w_ h
Postman自动化接口测试
Jenkins build prompt error: eacces: permission denied
Use of wangeditor rich text editor
Insect operator overloaded a fun
Some conclusions about Nan
李航老师新作《机器学习方法》上市了!附购买链接
Mysql database explanation (V)
GC is not used in D
ES基於Snapshot(快照)的數據備份和還原
The most critical elements of team management
[proteus simulation] Arduino uno key start / stop + PWM speed control DC motor speed
【MySQL从入门到精通】【高级篇】(二)MySQL目录结构与表在文件系统中的表示