开发者

What is %n in printf and how to use it? [duplicate]

开发者 https://www.devze.com 2023-04-04 11:14 出处:网络
This question already has answers here: What is the use of the 开发者_StackOverflow中文版%n format specifier in C?
This question already has answers here: What is the use of the 开发者_StackOverflow中文版%n format specifier in C? (12 answers) Closed 9 years ago.

What is %n in printf?

How to use it in my codes (with a sample code please)?

Thanks.

Edit:

After googling I couldn't found any sample about %n. But some people close this question without an answer.


The %n specifier does not print anything and the corresponding argument must be a pointer to signed integer where the number of characters written so far is stored.

Source C++ Reference

0

精彩评论

暂无评论...
验证码 换一张
取 消