Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/string/byte/memcmp"

From cppreference.com
< cpp‎ | string‎ | byte
m (Text replace - "{{cpp|" to "{{c|")
m (r2.7.3) (Robot: Adding fr, ja, pt, zh)
Line 33: Line 33:
 
{{dcl list template | cpp/string/byte/dcl list strncmp}}
 
{{dcl list template | cpp/string/byte/dcl list strncmp}}
 
{{dcl list end}}
 
{{dcl list end}}
 +
 +
[[fr:cpp/string/byte/memcmp]]
 +
[[ja:cpp/string/byte/memcmp]]
 +
[[pt:cpp/string/byte/memcmp]]
 +
[[zh:cpp/string/byte/memcmp]]

Revision as of 17:38, 4 May 2012

Template:cpp/string/byte/sidebar

Defined in header <cstring>
int memcmp( const void* lhs, const void* rhs, std::size_t count );

Compares the first count characters of the objects pointed to by lhs and rhs. The comparison is done lexicographically.

Contents

Parameters

lhs, rhs - pointers to the memory buffers to compare
count - number of bytes to examine

Return value

negative value if lhs is less than rhs.

0 if lhs is equal to rhs.

positive value if lhs is greater than rhs.

Example

See also

Template:cpp/string/byte/dcl list strcmpTemplate:cpp/string/byte/dcl list strncmp