当前位置:网站首页>[C language] do you really know printf? (printf is typically error prone, and collection is strongly recommended)
[C language] do you really know printf? (printf is typically error prone, and collection is strongly recommended)
2022-07-26 07:19:00 【rookieﻬ°】
List of articles
What is? printf()?
What we know printf Is to print out characters , Figures, etc. , But you know printf What is the return type of ?
after cplusplus.com Query for , hear printf The return type of is int type , The returned value is the total number of characters written .
Go straight to the topic ,printf The fallibility of
printf("%d ",printf("%d",printf("%d",43)));
Do you know the result of this statement ?
Think about it ~~~
Actually , The print result of the above statement is :4 3 2 1
- Why? ?
because , From the inside outprintf("%d ",43) Print is 43, Is that right ?
then , Because a total of two characters are written (43), So the one aboveprintf("%d ",43)The return value of is 2;
Give it to the nextprintfPrint , Print out 2;
then , Print 2 A total of 1 Characters , thereforeprintf("%d",2);The return value of is 1;
Return value 1 By the last oneprintf();Print , End of sentence ;
Do you understand ?
边栏推荐
- 如何对C盘进行扩容重新分区?
- Opencv learning color detection
- 5、多表查询
- 6、MySQL数据库的备份与恢复
- The interface automation test with a monthly salary of 12k+ takes you to get started in 3 minutes
- Lite actor: lightweight optimization of ark actor concurrency model
- Manifest merger failed with multiple errors, see logs
- centos7下的MySQL57版本,遇到一个问题不理解有知道的大shen告知
- No .egg-info directory found in xxx\pip-pip-egg-info-mq
- How to convert multi row data into multi column data in MySQL
猜你喜欢
![Leetcode:1898. maximum number of removable characters [if you want to delete some IDX from a pile of things, don't use pop]](/img/e6/a17902a73ff6a9d4393c96a019b78e.png)
Leetcode:1898. maximum number of removable characters [if you want to delete some IDX from a pile of things, don't use pop]

NFT数字藏品系统开发:激活数字文化遗产

Opencv learning basic functions

Leetcode 1184:公交站间的距离

College degree sales career, from the third tier 4K to the first tier 20k+, I am very satisfied with myself
![[yiku] wonderful! This library organization NPM script is simply explosive!](/img/84/e118c11f27aaf26e52059cb7ebc27a.png)
[yiku] wonderful! This library organization NPM script is simply explosive!

Advanced Mathematics (Seventh Edition) Tongji University exercises 2-5 personal solutions

It's another summer of open source. 12000 project bonuses are waiting for you!

The interface automation test with a monthly salary of 12k+ takes you to get started in 3 minutes

Solve the problem that Chrome browser is tampered with by drug bullies
随机推荐
Business secret series -- Talking about the evaluation of commercial passwords from the perspective of Party A and Party B (I)
The method of raspberry pie connecting tmall elf speaker to play music through Bluetooth
NFT数字藏品系统开发:NFT数藏 的最佳数字营销策略有哪些
Uncover the mystery of cloud native data management: operation level
anaconda安装教程-手把手教你安装
Typora免费版下载安装
Manifest merger failed with multiple errors, see logs
What are the basics of getting started with spot silver
Precious metal knowledge: lethal short-term secret script
What are the ways to open the JDBC log of Youxuan database
Unity3d asynchronous loading of scenes and progress bar loading
PG operation and maintenance -- logical backup and physical backup practice
Curl post request on the server, using postman tool for parameter conversion
6、MySQL数据库的备份与恢复
Drools (2): drools quick start
redis-migrate-tool迁移报错。
HCIP --- MPLS技术
Yolov6 target detection practice: training your own data set (video tutorial)
Common programming shortcut keys of idea (take off after learning the operation)
unity3d-对象池的用法