为什么错误发生在 Linux,而不是发生在 Visual Studio

Why does error occurs in Linux, not occuring in Visual Studio

我为 Linux(WSL)、Ubuntu 使用 Windows 个子系统。我试着编译简单的代码。

我在 WSL 中遇到错误。

但是,它在 Visual Studio 中运行良好。

gets_s() 是 Microsoft C 运行时库中定义的 gets() 的 "secure" 替代方法。它不包含在 Linux 中使用的 GNU C 库中。

为了便携性,请在 stdin 输入流上使用 fgets()