【问题标题】:How can I solve this problem: scanf with %[^\n]s error我该如何解决这个问题:scanf with %[^\n]s error
【发布时间】:2022-06-13 20:36:09
【问题描述】:

我想通过scanf输入一个带空格的数据来构造数组。 所以我写了这样的代码

scanf("%[^\n]s", addData->name);

但是使用“[^\n]”,我无法将数据输入到数组中。 如何输入有空格的数据?

【问题讨论】:

标签: c


猜你喜欢
  • 1970-01-01
  • 2020-03-25
  • 2020-02-14
  • 2021-10-23
  • 1970-01-01
  • 2021-07-31
相关资源
最近更新 更多