I'm compiling a C++ program using GCC on 64bits - machine/OS/ (with -m64
option passed to g++
). As expected, sizeof(long double) == 16
– I'm wondering whether there is 16 bytes-long standard type for integers?
P.S. __int128_t
is an artificial extension that emulates standard type as I understood. Other than that I didn't find anything.
As per the 2-bytes data capacity, an Int16's value capacity is -32768 to +32767.
A 16 byte field can hold up to 16 ASCII characters, or perhaps 8 CJK glyphs that might encode a short kanji or hanzi password. "A 16 byte field can hold up to 16 ASCII characters, or perhaps 8 CJK glyphs that might encode a short kanji or hanzi password." Assuming that you are using legacy encodings, of course.
Nope, only guaranteed sizes are for char
, unsigned char
& signed char
, and they are 1
:
5.3.3 Sizeof [expr.sizeof]
1 The sizeof operator yields the number of bytes in the object representation of its operand. The operand is either an expression, which is not evaluated, or a parenthesized type-id. The sizeof operator shall not be applied to an expression that has function or incomplete type, or to an enumeration type before all its enumerators have been declared, or to the parenthesized name of such types, or to an lvalue that designates a bit-field. sizeof(char), sizeof(signed char) and sizeof(unsigned char) are 1. The result of sizeof applied to any other fundamental type (3.9.1) is implementation-defined. [ Note: in particular, sizeof(bool) and sizeof(wchar_t) are implementation-defined.74) —end note ] [ Note: See 1.7 for the definition of byte and 3.9 for the definition of object representation. —end note ]
(emphasis mine)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With