I know how to assign a character string to an array -- one way would be like this:
char_str[] = "whatever string you want to assign";
But how does one assign a hex string? I tried this but it did not work:
char_str[] = 0x"003A00BE00C300C700C9";
Strangely enough, I do need those x'00' bytes within the array, even though in a C string x'00' indicates end of string. There's got to be a way to tell the compiler that those characters within the quotes are hexadecimal values. Come to think of it, that may not be possible (because of the null x'00') even if I knew how to tell the compiler that the string is hexadecimal. I may need to use a pointer and use memcpy to move the hex string into whatever pointer is point to. But there I would have the same problem: how do I indicate to memcpy that "003A00BE00C300C700C9" is hexadecimal? Thank you for your help.
char_str[] = "whatever string you want to assign";
But how does one assign a hex string? I tried this but it did not work:
char_str[] = 0x"003A00BE00C300C700C9";
Strangely enough, I do need those x'00' bytes within the array, even though in a C string x'00' indicates end of string. There's got to be a way to tell the compiler that those characters within the quotes are hexadecimal values. Come to think of it, that may not be possible (because of the null x'00') even if I knew how to tell the compiler that the string is hexadecimal. I may need to use a pointer and use memcpy to move the hex string into whatever pointer is point to. But there I would have the same problem: how do I indicate to memcpy that "003A00BE00C300C700C9" is hexadecimal? Thank you for your help.