Indeed, using the equality operator on two arrays is perfectly valid C, although it would only produce the desired result if those two arrays were actually the exact same array in memory. That happens because C compares addresses (because the name of an array is interpreted as the address of its first element), not contents. If you want to compare the contents, you can use memcmp().