Can I turn unsigned char into char and vice versa?

后端 未结 6 2105
死守一世寂寞
死守一世寂寞 2020-11-29 20:03

I want to use a function that expects data like this:

void process(char *data_in, int data_len);

So it\'s just processing some bytes really

6条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 21:03

    You really need to view the code to process() to know if you can safely pass in unsigned characters. If the function uses the characters as an index into an array, then no, you can't use unsigned data.

提交回复
热议问题