I am having trouble converting a int64_t to a char array and back. I don\'t know what is wrong with the code below, it makes complete logical sense to me. The code works for
void int64ToChar(char mesg[], int64_t num) { *(int64_t *)mesg = num; //or *(int64_t *)mesg = htonl(num); }