I am trying to perform a comparison of elements in:
std::vector<std::array<uint8_t, 6> > _targets =
{
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11 }
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x22 }
};
to a traditional array:
uint8_t _traditional[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x33 }
as:
for (auto target : _targets)
{
if (! memcmp(target, _traditional, 6)) {
known = 1;
}
}
and am receiving a data conversion error:
error: cannot convert 'std::array<unsigned char, 6u>' to 'const void*' for argument '1' to 'int memcmp(const
void*, const void*, size_t)
What is the propert byte wise comparison operation I can perform to accomplish equality evaluation?