[ENet-discuss] sending struct data

aaron andersen aaron.r.andersen at gmail.com
Mon Jan 26 08:26:45 PST 2009


The issue is that not all computers use the same endian- wikipedia would
have a great explanation I'm sure.
Any data type which is greater than 1 byte will need to be in the correct
byte order. A char is just one byte, so every computer would read that the
same way, but a typical int is 4 bytes hence big and little endian computers
would store them differently.

I hope this sufficiently answers your question.

On Mon, Jan 26, 2009 at 11:07 AM, Andrew Fenn <andrewfenn at gmail.com> wrote:

> On Mon, Jan 26, 2009 at 3:08 PM, Mark Palkow <palkow at daviko.com> wrote:
> > Is "strcat" the right thing?
> > I would try "strcpy" instead.
>
> Hurray, it works. One more question if you don't mind.
>
> I was reading in the mailing list that one should use the POSH library
> to convert all data to big endian before transmitting. This is done so
> that if one transmits from Mac -> Windows -> Linux the data doesn't
> end up as garbage. Is this correct? What data needs converting, just
> int and float not char?
>
> Sorry for all the silly questions.
>
> Thanks,
> Andrew
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>



-- 
aaron r andersen
tel: (647) 377-0401
e-mail: aaron.r.andersen at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20090126/5f10dfe4/attachment.htm>


More information about the ENet-discuss mailing list