I have an array of unsigned chars:
unsigned char buffer[BUFFER_SIZE];
I want to read in the first N unsigned chars from that array into a string however after looking at strncpy()
, that seems to only take pointers to signed chars.
Should I be looking at memcpy()
?
Not sure about the exact syntax but, if possible, you should use:
Also see:
Is there a good way to convert from unsigned char* to char*?