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

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -