所以我陷入两难境地.我需要比较两个C风格的字符串,我搜索了最合适的函数:
memcmp //Compare two blocks of memory (function)
strcmp //Compare two strings (function )
strcoll //Compare two strings using locale (function)
strncmp //Compare characters of two strings (function)
strxfrm //Transform string using locale (function)
Run Code Online (Sandbox Code Playgroud)
我认为第一个是地址,所以这个想法就出来了.第二个听起来对我来说是最好的选择,但无论如何我想听到反馈.其他三个让我一无所知.