I need to convert for exemple this number : 281474976710655 to a unsigned char array like this one :
unsigned char value[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
I try to memcpy and other techniques but i didn't get the correct value back, always random hex...
I'm not a c++ developer so thanks to explain if you can.
Thanks a lot, bye !
uint64_t x=281474976710655
unsigned char value[sizeof(x)];
std::memcpy(value,&x,sizeof(x));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With