I tried to parse uint64_t array to an array of char (result in decimal, separated by comma).
I used memcpy, every time I get a random values. iota() function converts max uint32_t values. I tried separate uint64_t to 2 uint32_t, but I never get a right result.
uint64_t numbers[10] = { 201234567890123456,
12345678901234567890,
98765432109876543,
65432109887,
12345234512345,
217631276371261627,
12354123512453124,
2163521442531,
2341232142132321,
1233432112 };
char array[1000] = "";
Expected result:
array = "201234567890123456,12345678901234567890,98765432109876543,65432109887,12345234512345,217631276371261627,12354123512453124,2163521442531,2341232142132321,1233432112"
I tried int64ToChar from this topic, but result is:
void uint64ToChar(char a[], int64_t n) {
memcpy(a, &n, 10);
}
uint64_t number = 12345678900987654;
char output[30] = "";
uint64ToChar(output, number);
Result:
�g]T�+
Thanks for any help.