“cpp/string/byte/memcmp”的版本间的差异

来自cppreference.com
< cpp‎ | string‎ | byte
(r2.7.3) (机器人添加:en, fr, ja, pt)
(Translated from the English version using Google Translate)
第1行: 第1行:
{{title|memcmp}}
+
{{
语法:
+
title| memcmp}}
 +
 +
 +
 +
  
<syntaxhighlight lang="cpp">
+
比 字符 。
    #include <cstring>
+
    int memcmp( const void *buffer1, const void *buffer2, size_t count );
+
</syntaxhighlight>
+
memcmp() 较buffer1和buffer2的前count 字符。 返回值如下:
+
  
{| class="wikitable"
+
=
|-
+
!值         
+
| ||  |
!解释
+
| ||  |
|-
+
}
| 小于0   
+
|buffer1 小于 buffer2
+
|-
+
| 等于0   
+
|buffer1 等于 buffer2
+
|-
+
|大于0
+
|buffer1 大于 buffer2
+
|}
+
  
 +
 +
 +
  
  相关主题: [[cpp/string/byte/memchr | memchr]], [[cpp/string/byte/memcpy | memcpy]], [[cpp/string/byte/memset | memset]], [[cpp/string/byte/strcmp | strcmp]]
+
 +
 
 +
 +
 
 +
 +
 +
  |
 +
 +
 +
 +
 
 +
 +
 +
cpp/string/byte/
 +
| cpp/string/byte/
 +
| /string/byte/
 +
  
[[en:cpp/string/byte/memcmp]]
 
 
[[fr:cpp/string/byte/memcmp]]
 
[[fr:cpp/string/byte/memcmp]]
 
[[ja:cpp/string/byte/memcmp]]
 
[[ja:cpp/string/byte/memcmp]]
 
[[pt:cpp/string/byte/memcmp]]
 
[[pt:cpp/string/byte/memcmp]]
 +

2012年10月25日 (四) 13:00的版本

在标头 <cstring> 定义
int memcmp( const void* lhs, const void* rhs, std::size_t count );
。比较countlhs指出,第一rhs字符的对象。比较是字典.
原文:
Compares the first count characters of the objects pointed to by lhs and rhs. The comparison is done lexicographically.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

。参数。

Template:param list begin Template:param list item Template:param list item Template:param list end

===。 返回值。===

。负值lhs是“小于”rhs.
原文:
Negative value if lhs is less than rhs.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
0如果lhs是“等于”rhs.
原文:
0 if lhs is equal to rhs.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
。正值lhs是“大于”rhs.
原文:
Positive value if lhs is greater than rhs.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

。为例。

。另请参阅。

Template:cpp/string/byte/dcl list strcmpTemplate:cpp/string/byte/dcl list strncmp
memcmp 的 C 文档