当前位置:网站首页>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
边栏推荐
- 泰山OFFICE技术讲座:使用字体粗体的四种情形
- Here Document免交互及Expect自动化交互
- 7-2 picking peanuts
- AGCO AI frontier promotion (6.26)
- 7.Consul服务注册与发现
- Mysql database explanation (IV)
- 古瑞瓦特冲刺港交所上市:创下“多个第一”,获IDG资本9亿元投资
- Mysql database explanation (V)
- I met the problem of concurrent programming in an interview: how to safely interrupt a running thread
- 爱可可AI前沿推介(6.26)
猜你喜欢

Jenkins build prompt error: eacces: permission denied

shell脚本详细介绍(四)

33. Use rgbd camera for target detection and depth information output

ICML 2022 | LIMO: 一种快速生成靶向分子的新方法

Cloudcompare - Poisson reconstruction

ES基於Snapshot(快照)的數據備份和還原

Use of wangeditor rich text editor

Nexys A7开发板资源使用技巧

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

8. Ribbon load balancing service call
随机推荐
A collection of common tools for making we media videos
Thinking caused by the error < note: candidate expectations 1 argument, 0 provided >
MongoDB系列之适用场景和不适用场景
Generation and rendering of VTK cylinder
Aesthetic experience (episode 238) Luo Guozheng
Jenkins build prompt error: eacces: permission denied
虫子 内存管理 下 内存注意点
Use of wangeditor rich text editor
NVM installation tutorial
Free machine learning dataset website (6300+ dataset)
Introduction to 26 papers related to CVPR 2022 document image analysis and recognition
Detailed sorting of HW blue team traceability process
D check type is pointer
Mongodb series window environment deployment configuration
Es sauvegarde et restauration des données par instantané
Es6: iterator
团队管理的最关键因素
7-2 picking peanuts
CloudCompare——泊松重建
character constants