当前位置:网站首页>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
边栏推荐
- MongoDB系列之Window环境部署配置
- Global variable vs local variable
- Ubuntu installation and configuration PostgreSQL (18.04)
- Echart stack histogram: add white spacing effect setting between color blocks
- LAMP编译安装
- 免费的机器学习数据集网站(6300+数据集)
- Calculate the distance between two points (2D, 3D)
- Network remote access using raspberry pie
- Gurivat sprint Harbour Exchange listed: created “multiple first”, received 900 million yuan Investment from IDG capital
- 证券开户安全吗,有没有什么危险啊
猜你喜欢

HW蓝队溯源流程详细整理

网络远程访问的方式使用树莓派

Ring queue PHP

I met the problem of concurrent programming in an interview: how to safely interrupt a running thread

Create your own cross domain proxy server

微信小程序注册指引

Guruiwat rushed to the Hong Kong stock exchange for listing: set "multiple firsts" and obtained an investment of 900million yuan from IDG capital

Tips for using nexys A7 development board resources

7.consul service registration and discovery

ES6:Map
随机推荐
李航老师新作《机器学习方法》上市了!附购买链接
Pytorch based generation countermeasure Network Practice (7) -- using pytorch to build SGAN (semi supervised GaN) to generate handwritten digits and classify them
[proteus simulation] Arduino uno key start / stop + PWM speed control DC motor speed
计算两点之间的距离(二维、三维)
Ring queue PHP
DataGrip配置的连接迁移
Nexys A7开发板资源使用技巧
泰山OFFICE技术讲座:使用字体粗体的四种情形
hands-on-data-analysis 第三单元 模型搭建和评估
8. Ribbon load balancing service call
Connection migration for DataGrid configuration
windows版MySQL软件的安装与卸载
Es snapshot based data backup and restore
ICML 2022 | LIMO: 一种快速生成靶向分子的新方法
Go language - pipeline channel
ES6 module
Postman自动化接口测试
输入文本自动生成图像,太好玩了!
NVM installation tutorial
7-2 the cubic root of a number