How do you compare structs for equality in C?

Hans Sjunnesson picture Hans Sjunnesson · Sep 26, 2008 · Viewed 186.5k times · Source

How do you compare two instances of structs for equality in standard C?

Answer

Greg Hewgill picture Greg Hewgill · Sep 26, 2008

C provides no language facilities to do this - you have to do it yourself and compare each structure member by member.