相关疑难解决方法(0)

比较两个C风格字符串的正确功能是什么?

所以我陷入两难境地.我需要比较两个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)

我认为第一个是地址,所以这个想法就出来了.第二个听起来对我来说是最好的选择,但无论如何我想听到反馈.其他三个让我一无所知.

c c++ string compare

6
推荐指数
1
解决办法
4307
查看次数

标签 统计

c ×1

c++ ×1

compare ×1

string ×1