【发布时间】:2016-04-23 15:09:44
【问题描述】:
我一直在研究其他问题,但没有一个解决方案有效,所以我会问我自己的问题。
我正在使用 linux VM 编译我的代码时遇到问题,这是我的包含、编译器收到的错误及其引用的代码:
错误:
linux.c:156:11:警告:函数“scan_s”的隐式声明 [-Wimplicit-function-declaration]
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include "ctype.h"
scanf_s("%[^\n]s", filename, maxFilename);
【问题讨论】:
-
scanf_s函数相当新,它是在 C11 标准中引入的,旧版 Linux 安装可能还没有。 -
请显示确切代码,或minimal reproducible example。该错误表明您使用了
scan_s而不是scanf_s。
标签: c compiler-errors scanf c11 tr24731