【问题标题】: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]”,我无法将数据输入到数组中。 如何输入有空格的数据? 【问题讨论】: fgets()? 标签: c