Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert BYTE to char ??

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hy everybody,

can anybody tell me how to convert BYTE to char ??
The Problem is, I want to send characters ( ASCII ) to the com port, but I've got to calculate it before, so I need the BYTE type !

I used the following solution, but I don't know if it's a stable solution:

BYTE byti;
char zchn;
byti= .....;
zchn=(char) bity;

Can anybody help me ??
Thanks,
SAM
 
That's usually the way I do it, and I haven't had much trouble with that. I think that it just interprets the 8 bits as ASCII instead of 8 plain bits.

MWB.
As always, I hope that helped!

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top