G
Guest
Is it possible to convert an unsigned long to byte array. For instance, unsigned long = 23480923
unsigned long longNumber;
longNumber=23480923; // in binary = 1 0110 0110 0100 1010 0101 1011
// so i want byteArray[0]=0000 0001 , byteArray[1]=0110 0110 ,
// byteArray[2]=0100 1010, byteArray[3]=0101 1011.
Is there a way to get the 4 bytes that make up this variable?
Also, is there a way to take a 4 byte array and convert it into a long?
TIA,
War Eagle
unsigned long longNumber;
longNumber=23480923; // in binary = 1 0110 0110 0100 1010 0101 1011
// so i want byteArray[0]=0000 0001 , byteArray[1]=0110 0110 ,
// byteArray[2]=0100 1010, byteArray[3]=0101 1011.
Is there a way to get the 4 bytes that make up this variable?
Also, is there a way to take a 4 byte array and convert it into a long?
TIA,
War Eagle