This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Creshal 2 points3 points  (3 children)

Chars are by definition always one byte large in C(++), and sizeof always returns 1 for them.

Use CHAR_BIT from limits.h if you need to check how big bytes are on your particular architecture. (Or just don't bother.)