gpt4 book ai didi

c - ANSI C : Pass variables from (s)scanf to function call

转载 作者:行者123 更新时间:2023-11-30 20:07:42 24 4
gpt4 key购买 nike

我的问题是是否可以直接将解析后的内容从 (s)scanf 传递到函数调用。换句话说,我是否必须初始化要传递给函数的变量(并通过 scanf 读取)。

最佳答案

sscanf 返回成功转换的数量。它不返回转换后的值。

因此,当将 sscanf 的返回值直接传递到另一个函数时,您不会传递新转换的数据(如果这就是您所要求的)。

关于c - ANSI C : Pass variables from (s)scanf to function call,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6089617/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com