在阅读:How can I check that elements of an array are all same without using counter?,@Skizz使用了漂亮的解决方案: memcmp (&string [0], &string [1], sizeof string [0] * (N - 1))
所以,如果N正好是1,我们得到 memcmp (&string [0]
我想比较两行pixel s。 A pixel被定义为包含4个值(RGBA)的struct。 我不使用memcmp的原因是因为我需要返回第一个不同像素的位置,而不是memcmp。 我的第一个实现使用SSE内部函数,并且是〜比memcmp慢30%: inline int PixelMemCmp(const Pixel* a, const Pixel* b, int count)
{
for