Reputation: 90756
This is probably very obvious, in fact so obvious that no C++ reference I could find online cares to document it.
I need to know how to set the byte value of a char
in C/C++. For example, if I want the byte value 233 in the char, how do I do?
Upvotes: 1
Views: 2246
Reputation: 4813
A char is a 1byte int. So you can set the value in the same way as you would an int.
char c = 123;
char d = 0x12;
etc...
Upvotes: 3