when comparing structures, compare each member.
maybe read some good books on c programming too which
will explain how c programmers use structures. k&r comes to mind

using a memcmp or similar as a rule of thumb is useful but
not very much as it won't dereference any elements that are pointers.
so compare each element and member.

cordially
Torquemada

On Sat, 16 Oct 2004, Lucas King wrote:

> hello,
>
> how does one compare two structures of the same type?
>
> Anjuta is returning an error when i compile :
>   if (sin1 == sin2) {
>     ..
>     ..
>   }
>
> where sin1 and sin2 are structures of the same type.  the sin structure
> is sockaddr_in.
>
> thanking you in advance,
>
> Lucas

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to