scanf is more primitive than you seem to think — %s will match everything up to the next whitespace. Your best solution is probably to stick with
strtok but throw it only content you've strduped from the authoritative original.
本文深入探讨了scanf函数的使用方式及其背后的原理,指出它实际上比我们通常认为的要更为基本。为了确保代码的健壮性和灵活性,作者推荐采用strtok结合复制自权威源代码的方法来替代scanf。
scanf is more primitive than you seem to think — %s will match everything up to the next whitespace. Your best solution is probably to stick with
strtok but throw it only content you've strduped from the authoritative original.
434

被折叠的 条评论
为什么被折叠?