Question

if I have in c++:

char abc[4];

abc[0] = 0xC0; //11000000 in binary

abc[1] = 0x20; //00100000 in binary

abc[2] = 0x44; //01000100 in binary

abc[3] = 0x20; //00100000 in binary

So how this will be stored in memory -

11000000 00100000 01000100 00100000 or the reverse way ??
----------------------------------- 
   0th      1st     2nd      3rd

In Java I am creating Bitset abc = new Bitset(32);

So I need to store the same values in this(same order).This may be modified later according to bit positions so have to be exact same way.

So abc[32] = 0xC0204420 will do? And if I want to store the values in c++ way what to do?? If I am wrong then how to do this in Java...

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top