using reinterpret_cast for pointers

I've created a typedef for an unsigned char (Byte). I want to read data into a buffer dynamically allocated with new , istream::read expects a char* so is it ok to use reinterpret_cast to convert the unsigned char* to char*?

Thanks
Some implementations are inconsistent about whether "char" alone is signed or unsigned, so it is good that you ask this.

In this case I am pretty sure it is perfectly safe to make that cast, as the signed/unsigned only changes the interpreted range of the type - the data is all the same.
Last edited on
Ok thanks L B for the info.
Topic archived. No new replies allowed.