当前位置:网站首页>[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 ?
边栏推荐
- How can man Bang write a new footnote to the value of the industry's first social responsibility report?
- Overview of new features of es11, ES12 and es13
- Leetcode 1184: distance between bus stops
- NFT数字藏品系统开发:NFT数藏 的最佳数字营销策略有哪些
- Check the top 10 best graphics software of the year, meet 99% of your chart needs, and collect it quickly
- Leetcode:749. isolate virus [Unicom component + priority queue + status representation]
- [yiku] wonderful! This library organization NPM script is simply explosive!
- How regular expressions write variables
- Qt:列表框、表格、树形控件
- Usage of unity3d object pool
猜你喜欢

NFT数字藏品系统开发:NFT数藏 的最佳数字营销策略有哪些

Leetcode 1184:公交站间的距离

"Wei Lai Cup" 2022 Niuke summer multi school training camp 1 supplementary question record (acdgij)

Advanced Mathematics (Seventh Edition) Tongji University General exercises two person solution

4、数据的完整性
![Rgb-t tracking - [dataset benchmark] gtot / rgbt210 / rgbt234 / vot-2019-2020 / laser / VTUAV](/img/10/40d02da10a6f6779635dc820c074c6.png)
Rgb-t tracking - [dataset benchmark] gtot / rgbt210 / rgbt234 / vot-2019-2020 / laser / VTUAV

How can man Bang write a new footnote to the value of the industry's first social responsibility report?

中国联通改造 Apache DolphinScheduler 资源中心,实现计费环境跨集群调用与数据脚本一站式访问

Summer Challenge harmonyos - hamster game based on arkui (JS)

Precious metal knowledge: lethal short-term secret script
随机推荐
Manifest merger failed with multiple errors, see logs
unity3d-对象池的用法
NFT数字藏品系统开发:企业如何开发属于自己的数藏平台
Deep learning learning notes -- solve the problem of slow download of CONDA and pip
Opencv learning color detection
Getting started with kernel PWN (5)
NLP自然语言处理-机器学习和自然语言处理介绍(三)
From scratch, we will completely develop an online chess game [Gobang] Based on websocket, and only use dozens of lines of code to complete all the logic.
College degree sales career, from the third tier 4K to the first tier 20k+, I am very satisfied with myself
[romance understood by technical talents] tidb community has prepared a gift for your partner for the "Tanabata Festival". Reply: if I want to challenge, I can participate in the activity!
HCIP---BGP综合实验
NFT数字藏品开发:数字藏品助力企业发展
The interface automation test with a monthly salary of 12k+ takes you to get started in 3 minutes
Drools(3):Drools基础语法(1)
倒计时2日!基于 Apache DolphinScheduler&TiDB 的交叉开发实践,从编写到调度让你大幅提升效率
NFT数字藏品系统开发:文学+数字藏品的碰撞
数据平台调度升级改造 | 从Azkaban 平滑过度到 Apache DolphinScheduler 的操作实践
NFT digital collection system development: how enterprises develop their own digital collection platform
Usage of unity3d object pool
NFT数字藏品系统开发:激活数字文化遗产