• 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: Converting float array to UInt8 for writing to a stream.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting float array to UInt8 for writing to a stream.


  • Subject: Re: Converting float array to UInt8 for writing to a stream.
  • From: Scott Ribe <email@hidden>
  • Date: Sun, 14 Nov 2004 18:41:51 -0700

> Note that you cannot just type-cast between types, since that will
> attempt to perform a conversion of some sort, which may or may not give
> you what you ultimately want.

Not with pointers, so with a plain C array a simple cast is adequate, of
course this is not the case with a CFArray...

 float floats[xxx];
 CFWriteStreamWrite( mystream, (UInt8 *) floats, sizeof( floats ) );

Would work, assuming no need for byte swapping. Any needed byte swapping
could be performed in place on an array/pointer, or on a copy...


--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 665-7007 voice


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Converting float array to UInt8 for writing to a stream. (From: Wade Tregaskis <email@hidden>)

  • Prev by Date: Re: System Configuration came online ???
  • Next by Date: detecting sockets
  • Previous by thread: Re: Converting float array to UInt8 for writing to a stream.
  • Next by thread: System Configuration came online ???
  • Index(es):
    • Date
    • Thread