Mar 11, 2016 at 8:18am
Hi Guys,
How to convert Char to byte in C++?
Mar 11, 2016 at 8:57am
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?
Mar 11, 2016 at 9:33am
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 Mar 11, 2016 at 9:37am
Mar 11, 2016 at 10:16pm
A char is exactly the same as a byte, although bytes on the target platform may not be octets.