我们可以在scanf函数中获得多少个值? [英] how many values we can get in scanf function?

查看:170
本文介绍了我们可以在scanf函数中获得多少个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在scanf函数中获取多少个值?即在scanf函数中获取输入的限制

how many values we can get input in scanf function?i.e limitation of getting input in scanf

推荐答案

标准"中没有定义限制-表示它可能取决于实现,并且在系统之间可能会有所不同,具体取决于库作者在编写它时的感受.

但是...鉴于它是从stdin读取的,因此是供用户输入的,而不是供文件使用的,因此最好将单个语句中的处理量减至最少,以减少用户使用时的"PITA因子"在第二个值上犯了一个错误...
There is no limit defined in "the standard" - which means it''s likely to be implementation dependant, and can vary from system to system depending on how the library author was feeling when you wrote it.

But...given that it reads from stdin and thus is intended for user input rather than a file it would probably be a good idea to minimise the amount you process in a single statement in order to reduce the "PITA factor" when the user makes a mistake in the second value...


这篇关于我们可以在scanf函数中获得多少个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆