Discussion
How to declare a wide character in the string literal?
Answer: A
Correct answer: L prefix
A wide string literal is written with an L prefix - L"text" - which gives an array of wchar_t rather than of char. The same prefix on a character constant, L'x', gives a wide character.
Later standards added further prefixes for specific encodings: u8 for UTF-8, u for char16_t and U for char32_t. The lower-case l is not a valid prefix, prefixes in C being case-sensitive.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development