In C++, What is the most efficient way (memory and timing) to compare two structs of word size (eg. size of 4 Bytes in 32 bit architecture). assume no garbage padding bits and:
struct A, B;
on one hand, I can use
memcmp(&A, &B, 4)
on the other hand, I can write
struct *pA = &A; struct *pB = &B;
if (*pA == *pB)
thanks