简体   繁体   English

如何在Objective-C中使用scanf?

[英]How to use scanf in Objective-C?

朋友们如何在目标c中使用scanf,当我编译它时工作得很好但是在运行时间它是无限的...请尽快给我解决方案感谢.....

scanf is not useful for iPhone programs as there is no facility to run in console mode. scanf对iPhone程序没用,因为无法在控制台模式下运行。

sscanf is sometimes useful but you are probably better off using NSNumberFormatter. sscanf有时很有用,但你可能最好使用NSNumberFormatter。

For more info see: 有关详情,请参阅:

Always check the return value of scanf. 始终检查scanf的返回值。

check = scanf(...);
if (check != EXPECTED_VALUE) hanlde_error();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM