
converting const char* to unsigned char[1024]
Quote:
> hi I am trying to converting const char* to unsigned char[1024]--
>> how is that done?
if your const char * is pointing to 1024 bytes of allocated data, then you
can do just use memcpy:
const char *p;
unsigned char a[1024];
p = malloc(1024);
/* ... blah blah blah ... */
/* copy the data pointed to by 'p' into the array 'a' */
memcpy(a, p, 1024);
note that if char is signed, then you might get some strange values (but
then again you might not). hope it works out for you.
--
/"\ m i k e b u r r e l l
X AGAINST HTML MAIL
/ \