Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 1.54 KB

character-types.md

File metadata and controls

32 lines (28 loc) · 1.54 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Character Types | Microsoft Docs
11/04/2016
cpp-language
article
C++
character data types [C]
types [C], character
d3ca8cda-c0d7-43af-9472-697e8ef015ce
7
mikeblome
mblome
ghogen

Character Types

An integer character constant not preceded by the letter L has type int. The value of an integer character constant containing a single character is the numerical value of the character interpreted as an integer. For example, the numerical value of the character a is 97 in decimal and 61 in hexadecimal.

Syntactically, a "wide-character constant" is a character constant prefixed by the letter L. A wide-character constant has type wchar_t, an integer type defined in the STDDEF.H header file. For example:

char    schar =  'x';   /* A character constant          */  
wchar_t wchar = L'x';   /* A wide-character constant for   
                            the same character           */  

Wide-character constants are 16 bits wide and specify members of the extended execution character set. They allow you to express characters in alphabets that are too large to be represented by type char. See Multibyte and Wide Characters for more information about wide characters.

See Also

C Character Constants