liveBook · Manning

Code point

As explained in Modern C

A code point is a numeric value assigned by a character standard to a character concept.

A character in a C string

The C string "\u00E4" specifies “Latin small letter a with diaeresis.” Its Unicode code point is 228, or 0xE4. The escape names the character; the multibyte string’s byte sequence is a separate matter. section 14.3

A code point identifies a character concept, not its printed shape, or glyph. “Latin capital letter A” can have several glyphs, while “Greek capital letter Alpha” can look similar. Unicode also classifies characters and records relationships such as capitalization. section 14.3

43   #define VBAR "\u2502"      /**< a vertical bar character   */
44   #define HBAR "\u2500"      /**< a horizontal bar character */
45   #define TOPLEFT "\u250c"   /**< topleft corner character   */
46   #define TOPRIGHT "\u2510"  /**< topright corner character  */


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":0},{\"line\":0,\"ch\":2}],[{\"line\":0,\"ch\":5},{\"line\":0,\"ch\":12}],[{\"line\":1,\"ch\":5},{\"line\":1,\"ch\":12}],[{\"line\":2,\"ch\":5},{\"line\":2,\"ch\":12}],[{\"line\":3,\"ch\":5},{\"line\":3,\"ch\":12}],[{\"line\":1,\"ch\":0},{\"line\":1,\"ch\":2}],[{\"line\":0,\"ch\":5},{\"line\":0,\"ch\":12}],[{\"line\":1,\"ch\":5},{\"line\":1,\"ch\":12}],[{\"line\":2,\"ch\":5},{\"line\":2,\"ch\":12}],[{\"line\":3,\"ch\":5},{\"line\":3,\"ch\":12}],[{\"line\":2,\"ch\":0},{\"line\":2,\"ch\":2}],[{\"line\":0,\"ch\":5},{\"line\":0,\"ch\":12}],[{\"line\":1,\"ch\":5},{\"line\":1,\"ch\":12}],[{\"line\":2,\"ch\":5},{\"line\":2,\"ch\":12}],[{\"line\":3,\"ch\":5},{\"line\":3,\"ch\":12}],[{\"line\":3,\"ch\":0},{\"line\":3,\"ch\":2}],[{\"line\":0,\"ch\":5},{\"line\":0,\"ch\":12}],[{\"line\":1,\"ch\":5},{\"line\":1,\"ch\":12}],[{\"line\":2,\"ch\":5},{\"line\":2,\"ch\":12}],[{\"line\":3,\"ch\":5},{\"line\":3,\"ch\":12}]]"}
!@%STYLE%@!

These C macros use four-digit \u escapes to specify box-drawing characters, including horizontal and vertical bars. section 14.3

TAKEAWAY: In C11, \u followed by four hexadecimal digits specifies a Unicode code point; \U followed by eight digits provides a wider range. A configured system may also let you type the character directly into a multibyte string. section 14.3

How Modern C covers it

How deep it goes
Defines the distinction from glyphs and works through C11 escape syntax without detailing the resulting byte encoding.
Examples
Uses \u00E4 for ä and escaped box-drawing characters in C macros.
What you can do after
Apply it via C11 \u and \U escapes to specify Unicode characters in multibyte strings.
How it connects
Links Unicode to glyphs, multibyte strings, character classification, and capitalization.

Also explained in

Compare how 6 books explain code point →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Modern C. The section links point to the parts of the book it draws on.