Functions for comparing 2 bytearrays
I have two byte arrays of same length. Now i want to check if any value of the first array is different from any value of the second array. Is there any ready made functions that i can use rather than checki开发者_开发百科ng item by item of the arrays. I am using VC 6.0
http://www.cplusplus.com/reference/clibrary/cstring/memcmp/
I'd say you have the choice between :
- The C-inherited
memcmp
from<cstring>
- The C++ standard library
std::equal
from<algorithm>
I don't know how good/bad is VC6.0 support of standard library, so memcmp
is probably the safest here.
精彩评论