Serial Communication (Verifying Incoming data)

Are the grounds of all three devices connected?

Also how would I go about using memcmp() in my if statement which checks all the bytes?

Have you met my friend google?