-3

I would like to convert an array of signed char to an array of unsigned char in C. How can I do it ?

Wolf
  • 9,679
  • 7
  • 62
  • 108
user655561
  • 659
  • 1
  • 9
  • 24
  • 1
    What do you mean saying "to convert"? – Eldar Abusalimov Apr 29 '12 at 19:23
  • Please see: [Stack Overflow is not your personal research assistant](http://meta.stackexchange.com/a/128553/172496). What may be confusing you is that [Stack Overflow is not like all those other sites](http://meta.stackexchange.com/a/128554/172496) – Brian Roach Apr 29 '12 at 19:24
  • I think instead of give full answer,wait for the author of thread show what he have tried and then points a way. – Jack Apr 29 '12 at 19:37
  • I'd think it's casting what was searched for https://stackoverflow.com/a/5042335/2932052 – Wolf Sep 20 '17 at 13:37

1 Answers1

5

Why not use memcpy?

unsigned char uChars[count];
signed char sChars[count];

memcpy(uChars, sChars, count);
Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201