liveBook · Manning

Char(n)

CHAR(n) is a fixed-length SQL character-string data type whose values occupy the declared character length, typically with trailing-space padding.

How 5 Manning books explain it

Learn Rust in a Month of Lunches

Rust's char type represents one Unicode scalar value and occupies four bytes.

How it is used
Uses `char` to represent one Unicode scalar value and to distinguish characters from string byte lengths.
How deep it goes
Defines `char`, works through storage and conversion examples, then surveys selected methods without cataloging them all.
Examples
Shows quoted characters, byte-size comparisons, a failed integer cast, Unicode escapes, and conversions from integers.
What you can do after
Evaluate/understand it by distinguishing fixed-size `char` storage from UTF-8 byte lengths and choosing character counts when needed.

Read how Learn Rust in a Month of Lunches explains char(n) →

Grokking Relational Database Design

CHAR is a fixed-length SQL character-string data type whose declared length determines its stored character width.

How it is used
Guides choosing a string type for attributes whose values have a uniform length.
How deep it goes
Defines selection rules and applies declared widths to card, expiry-date, and product-code attributes.
Examples
Uses state or province codes, card numbers, expiry dates, and UPC product codes.
What you can do after
Apply it to define fixed-width codes and numeric-looking identifiers as strings rather than integers.

Read how Grokking Relational Database Design explains char(n) →

Modern C, Third Edition

char is a C character type that occupies exactly one byte and is intended to represent individual characters.

How it is used
Represents printable characters and string data while also serving as a narrow integer type.
How deep it goes
Defines size, signedness variation, object representation, and arithmetic promotion, but does not develop advanced pointer techniques.
Examples
Uses printable character data, sizeof(char), arithmetic promotion, and an unsigned-char view of an object.
What you can do after
Evaluate/understand char declarations, byte size, promotion behavior, and the distinction between character data and object representation.

Read how Modern C, Third Edition explains char(n) →

100 SQL Server Mistakes and How to Avoid Them

CHAR is a SQL Server fixed-length, non-Unicode character data type that stores one byte per character and pads values to the declared length.

How it is used
Contrasts fixed-length and variable-length strings when choosing SQL Server column types.
How deep it goes
Traces whitespace padding into byte usage, 8 KB pages, and row-slot metadata.
Examples
Uses US address fields, CHAR(8) containing Hello!, and a DepartmentCode alteration.
What you can do after
Evaluate fixed-length string choices by accounting for padding and declared storage length.

Read how 100 SQL Server Mistakes and How to Avoid Them explains char(n) →

Modern C

char is the C integer type used to represent characters and small integer values.

How it is used
Represents basic-set characters and supports string and character-array operations.
How deep it goes
Explains representation, termination, initialization, encoding assumptions, and library interfaces, but defers broader integer details.
Examples
Uses jay initializers and a complete program copying argv[0] into a variable-length char array.
What you can do after
Apply it via string.h by distinguishing terminated strings from length-bounded char arrays.

Read how Modern C explains char(n) →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.