Re: Converting float array to UInt8 for writing to a stream.
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