Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Expert-Q: (a!=b) != memcmp(&a,&b,sizeof a) ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
alex_krol  
View profile   Translate to Translated (View Original)
 More options 28 June 1999, 08:00
Newsgroups: comp.lang.c
From: Alex_K...@scitex.com
Date: 1999/06/28
Subject: Re: Expert-Q: (a!=b) != memcmp(&a,&b,sizeof a) ?
In article <377738B4.97C7...@hls.via.at>,
  Helmut Leitner <leit...@hls.via.at> wrote:

> Let's assume that a and b have the same basic data type
> (e.g. int, long, float, double ...).

> On many platforms it is possible to replace the
> comparisions
>    a==b
>    a!=b
> by
>    memcmp(&a,&b,sizeof(a))==0
>    memcmp(&a,&b,sizeof(a))

> What are the conditions that this will not yield the
> desired results?

   I can think of two:
  a) holes in data type representation
  b) +0 and -0 for one's complement platforms

--
        Regards,
                Alex Krol
Disclaimer: I'm not speaking for Scitex Corporation Ltd

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google