A
Angus
Hello
I have a load of bytes like this:
unsigned char mybyte[] = {0xa1, 0x14, 0x02, 0x01, 0x01, 0x02, 0x01, 0x0a,
0x30, 0x0c, 0x80,
0x03, 0x32, 0x30, 0x31, 0x62, 0x05, 0x80, 0x03, 0x32, 0x30, 0x32};
But I want to write them as a string. so I tried this:
char szSend[] =
"\x0a1\x014\x002\x001\x001\x002\x001\x00a\x030\x00c\x080\x003201\x062\x005\x
080\x003202";
But that gave me a compile error
error C2022: '12801' : too big for character
error C2022: '12802' : too big for character
Can I not do this? What is easiest way for me to put these non printing
characters into a string? Or will I need to use something like sprintf to
do this?
I have a load of bytes like this:
unsigned char mybyte[] = {0xa1, 0x14, 0x02, 0x01, 0x01, 0x02, 0x01, 0x0a,
0x30, 0x0c, 0x80,
0x03, 0x32, 0x30, 0x31, 0x62, 0x05, 0x80, 0x03, 0x32, 0x30, 0x32};
But I want to write them as a string. so I tried this:
char szSend[] =
"\x0a1\x014\x002\x001\x001\x002\x001\x00a\x030\x00c\x080\x003201\x062\x005\x
080\x003202";
But that gave me a compile error
error C2022: '12801' : too big for character
error C2022: '12802' : too big for character
Can I not do this? What is easiest way for me to put these non printing
characters into a string? Or will I need to use something like sprintf to
do this?