how to convert in c++ int value to 4 byte representation.
I tried in that way:
int digit = 2;
unsigned char a[4];
a[3] = (digit>>24) & 0xFF;
a[2] = (digit>>16) & 0xFF;
a[1] = (digit>>8) & 0xFF;
a[0] = digit & 0xFF;
cout << a[0] << a[1] << a[2] << a[3] << endl;
but cout don't display anything.