• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Strangeness when moving data through an array.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Strangeness when moving data through an array.


  • Subject: RE: Strangeness when moving data through an array.
  • From: Jeff Laing <email@hidden>
  • Date: Wed, 1 Dec 2004 16:05:46 +1100

> Now, I take the data from "pkt" and I want to later stick it into a
> 16 bit (u_short),  and would expect...   short_test=258,  but
> after I execute this statement...
>
>     bcopy((u_short)&pkt[MSEQ], &short_test, 2);

Um, haven't you cast your source address down to a 16-bit value?

ie, the (u_short) out the front of &pkt[MSEQ} takes a 32-bit address and
loses the top 16 bits...
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Strangeness when moving data through an array.
  • Next by Date: NSTableView
  • Previous by thread: Re: Strangeness when moving data through an array.
  • Next by thread: NSTableView
  • Index(es):
    • Date
    • Thread