About multi character literals

Asked 2 years ago, Updated 2 years ago, 25 views

In C++, we were investigating the single quotation mark (' ) (it was about the content that would change to a number if a string was in the single quotation mark) http://hashcode.co.kr/questions/237/ Small Quotes-In-Character-Multiple-Writing-Case I saw the word "multi character literature" in...It's hard to find a description of the word, so I'm posting a question.

I would like to know what multi character literal means in C++ and where it is used.

c++

2022-09-22 21:18

2 Answers

IBM Knowledge Center - Character Literals has this description.

A character literal contains a sequence of characters or escape sequences enclosed in single quotation mark symbols, for example 'c'. A character literal may be prefixed with the letter L, for example L'c'. A character literal without the L prefix is an ordinary character literal or a narrow character literal. A character literal with the L prefix is a wide character literal. An ordinary character literal that contains more than one character or escape sequence (excluding single quotes ('), backslashes () or new-line characters) is a multicharacter literal.

C++A character literal that contains only one character has type char, which is an integral type. A multicharacter literal has type int.

In short, character literal is a sequence of characters or escapes enclosed in single quotes. In C++, character literature is char type, and multicharacter literature is int type.


2022-09-22 21:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.