The return value of sha256
is bytes32
. So use bytes32 a = sha256(...)
and do the same for b
. This will fix the compiler errors and a == b
will work.
But currently you cannot pass a struct to hashing functions like sha256
, keccak256
: https://github.com/ethereum/solidity/issues/980. So generally the members of the structs have to be compared against each other. A more specific question may help to uncover possible optimizations (for example, there may be ways to reduce the comparisons required depending on the app design).