you can just use a simple memcmp here `if memcmp (lpaccelNew[i], lpaccelNew[newItem]) == 0)`