scanf 的返回值
时间: 2023-08-15 10:15:12 浏览: 100
scanf函数解析
scanf的返回值是成功读取并赋值的参数的个数。在引用\[1\]中提到,printf的返回值是输出的字符数,而scanf的返回值是成功读取并赋值的参数的个数。所以,如果scanf成功读取并赋值了3个参数,返回值就是3。\[1\]
#### 引用[.reference_title]
- *1* *2* [scanf 函数的返回值](https://blog.csdn.net/yishengchizha/article/details/79687885)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [VsStudio中scanf返回值被忽略的原因及其解决方法](https://blog.csdn.net/Daears/article/details/126479320)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文