【发布时间】:2021-10-06 11:34:12
【问题描述】:
我将在onlinegdb.com上编译一个非常简单的代码
代码如下。
#include <stdio.h>
#include <string.h>
int main()
{
char s[10] = {0};
strcpy_s(s, 10, "1234567890");
printf("%s", s);
return 0;
}
我选择了选项语言为C++、C++14和C++17,但所有这些都没有编译strcpy_s。
上面写着:
main.cpp: In function ‘int main()’:
main.cpp:16:33: error: ‘strcpy_s’ was not declared in this scope
strcpy_s(s, 10, "1234567890");
^
我用谷歌搜索了分钟,但没有答案。
gdb online不支持c++11以上的c编译器吗?请帮帮我。谢谢。
【问题讨论】: