How do I convert an unsigned int (UINT32) to a const char.
I tried to cast it but because isn’t type safe is crashing when the pointer is bigger than expected.
So how can I approach this correctly?
unsigned int p = 0x32422342;
strLocation = QString::fromUtf8((char*)p, sizeof(p));
BTW if I leave the cast, the compiler is showing up an exception:
cast to `const char*`from smaller integer type `UINT32` (aka `unsigned int`) [-Wint-to-pointer-cast]
any suggestions? The value is just a random number, just for clarification.
char *), which, from the error message, seems to be wider than 32bits (64bits). - didierc