- Home /
Variables representation in bytes?
Hi, I'm using the google play services plug-in and to send the info online I need to convert it into an array of bytes, so I need to know how many bytes needs every variable. At this moment I know that a float is represented with 4 bytes, but I can't find how many bytes are needed for bools and ints. Can anyone clarify me this or link some resource where I can read about it?
Thanks a lot!
Comment
Best Answer
Answer by DoTA_KAMIKADzE · Jun 13, 2015 at 06:26 PM
Go to THIS page, get a calculator and divide the "Width" column (which represents amount of bits) value of respective type that you need by 8, because byte is of width 8. E.g. for bool - 1, for int - 4.