and here's the complete code for taking apart a float and putting it back together:
int breakDown(int index, unsigned char outbox[], float member)
{
unsigned long d = *(unsigned long...
Type: Posts; User: mynameisnate
and here's the complete code for taking apart a float and putting it back together:
int breakDown(int index, unsigned char outbox[], float member)
{
unsigned long d = *(unsigned long...
Thanks, I just finished correcting the bit masks in my code before I saw this.
So if I understand yours and the above posts, my code should look like:
int SplitPacket(int index, unsigned char outbox[], float member)
{
unsigned char *d = (unsigned int *)&member;
...
Yeah, I did this algorithm with a union of my float struct and an array of unsigned char that made everything so much nicer. What I'm trying to do with this is show why the method you described is...
Hello All,
I'm working on a program that takes a struct of floats, breaks them down into an array of uchar (byte array) then reassembles the struct from the data.
How can I take a float...
So I'm working on something right now at work trying to improve upon a system for taking a struct of floats, breaking it down into bytes, passing it around, and then reassembling the data.
I've...
Holy crap, how did I miss that. That's what you get when you program while trying to comfort a sick 1 year-old in the middle of the night. Thanks Rags.
Hi all. I'm a mechanical engineer and new to this forum. I'm doing some refresher courses on C and am trying to figure out why my program is erroring out on me. I'd appreciate any help. The...