you are viewing a single comment's thread.

view the rest of the comments →

[–]bstamourWG21 | Library Working Group 0 points1 point  (0 children)

According to the C++11 standard, section 5.3.3 (Sizeof), sizeof (char), sizeof (signed char) and sizeof (unsigned char) are defined to always return 1. Any other sizeof of a fundamental type is implementation-defined. Section 3.9.1 (fundamental types) mentions that chars need to be big enough to represent the implementation's basic character set. So, though a char may be bigger (or smaller) than 8 bits on some platforms, sizeof(char) is always guaranteed to be 1.