我需要重现strnstr功能的行为。我想测试strnstr但无法编译程序,其编写的"implicit declaration of function strnstr [-Wimplicit-function-declaration]"和"undefined reference to strnstr". 我包括了 header <string.h>。
我知道这strnstr()不在标准库中,问题可能与编译器有关,但是如何修复它以使用它strnstr()?
编译器版本:gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609