char to byte

Hi Guys,
How to convert Char to byte in C++?
On most systems char is equivalent to a byte (8 bits).

Actually the type byte doesn't exist in C/C++. What are you trying to do?
In c++ Byte is equal to unsigned char.
Conversion from char to unsigned char will be like as below

unsigned char test=(unsigned char) ('T');
unsigned char is actually 8 bit unsigned integer
Last edited on
A char is exactly the same as a byte, although bytes on the target platform may not be octets.
thanqqq friends
Topic archived. No new replies allowed.