I'm trying to do something like this:
struct SomeStruct {
const char *bytes;
const char *desc;
};
SomeStruct example = { { 0x10, 0x11, 0x12, 0x13 }, "10-13" };
Why isn't this working?
Probably because { 0x10, 0x11, 0x12, 0x13 }
is an array of char
, not a pointer to char
.
Try SomeStruct example = { "\x10\x11\x12\x13", "10-13" };
instead.
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