Comparing D structs

grauzone none at example.net
Sun May 17 12:58:27 PDT 2009


Dan wrote:
> Structs can't easily be compared in C because of potential 'padding' inside the struct which may (or may not) exist.
> 
> I was jut wondering if D somehow gets round this, and allows something like memcmp to easily compare two structs.

How about using the == operator?


More information about the Digitalmars-d-learn mailing list