[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to quickly compare equality of structs ...

From: Paul Eggert
Subject: Re: How to quickly compare equality of structs ...
Date: Mon, 6 May 2019 14:22:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/6/19 1:40 PM, Keith David Bershatsky wrote:
> C provides no method for comparing equality of structs

You can compare each member of the struct yourself. Or you can use
memset to clear all the bytes in the struct (including padding bytes)
before initializing the struct members, and then use memcmp on the result.

> Based on my limited experience with hash tables in Lisp, I am unable to 
> visualize how I could use such a table in C to do my comparison for each fake 
> cursor ....

I'm sure there's a way.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]