标签: c strcat-s
我尝试包含string.h和stdlib.h,但仍然会收到未定义的引用编译错误。
string.h
stdlib.h
这使我得出结论,它在一个不同的库中,我没有包含。它在哪里?
我正在使用gcc编译器 - 代码是用Windows编写的,但是将在unix服务器上编译和运行。
答案 0 :(得分:8)
strcat_s
string.h。一般来说,只有微软已经实现了这些替代功能。
答案 1 :(得分:4)
string.h位于windows platform
您也可以参考此cppreference
在标题<string.h> 中定义
在标题<string.h>
<string.h>
如果您使用的是UNIX平台,则可以更好地使用 strcat 。
答案 2 :(得分:4)
slibc中有一个实现。
答案 3 :(得分:2)
它似乎是C11标准的一部分:
http://en.cppreference.com/w/c/string/byte/strcat
https://www.securecoding.cert.org/confluence/display/c/API02-C.+Functions+that+read+or+write+to+or+from+an+array+should+take+an+argument+to+specify+the+source+or+target+size
老实说,在谈到标准时我并不是很精通,而且我很可能错了&gt;。&lt;