Does C++ allow 8 byte long multi-character literals? -


why allowed:

uint32_t x = 'name';

but gets truncated 32 bits:

uint64_t x = 'namename';

is there way have 8-byte long multicharacter literal?

yes, long compiler has 8-byte ints , supports it.

the c++ standard farily terse regarding multi-character literals. has on matter (c++14, 2.14.3/1):

an ordinary character literal contains more 1 c-char multicharacter literal. multicharacter literal, or ordinary character literal containing single c-char not representable in execution character set, conditionally-supported, has type int, , has implementation-defined value.

(emphasis mine)

as see, pretty standard says if multicharacter literals supported (they don't have be), of type int. value compiler.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -