• 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
"byte orders" question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"byte orders" question


  • Subject: "byte orders" question
  • From: Koen van der Drift <email@hidden>
  • Date: Fri, 25 Nov 2011 15:58:21 -0500

I'm trying to implement the following code into my Cocoa project:

for (n = 0 ; n < (2 * count) ; n++)
{
	((u_int32_t *) result)[n] = ntohl((u_int32_t) ((u_int32_t *) decoded)[n]);
 }

with the following requirements:

// byte order correction decoded has network byte order data
// result has the byte order of the host machine

decoded is an NSData object after base64 decoding.

How do I obtain the "network byte order data" and "byte order of the host machine" so I get the correct results?

Thanks,

- Koen._______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: "byte orders" question
      • From: Ben Kennedy <email@hidden>
    • Re: "byte orders" question
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Lexical or Preprocessor Issue 'Cocoa/Cocoa.h file not found
  • Next by Date: Re: Lexical or Preprocessor Issue 'Cocoa/Cocoa.h file not found
  • Previous by thread: Re: Lexical or Preprocessor Issue 'Cocoa/Cocoa.h file not found
  • Next by thread: Re: "byte orders" question
  • Index(es):
    • Date
    • Thread