liveBook · Manning

Size_t

size_t is an unsigned integer type in C and C++ used to represent object sizes and related counts.

How 2 Manning books explain it

Modern C

size_t is an unsigned integer type provided by the C standard library for representing object sizes and related counts.

How it is used
Uses size_t to express object sizes, cardinalities, and related counts with semantic type information.
How deep it goes
Explains size_t’s semantic classification and +, -, and * rules, but defers detailed overflow handling.
Examples
Demonstrates grouped expressions, unary operators, and values 45 and 7 producing 76 and 31.
What you can do after
Evaluate/understand size_t expressions and recognize when unsigned results are representable or overflow.

Read how Modern C explains size_t →

100 C++ Mistakes and How to Avoid Them

size_t is an unsigned integer type capable of representing the size of any object in C++.

How it is used
Represents object and container sizes while illustrating a boundary where automatic type deduction becomes unsafe.
How deep it goes
Defines its size guarantee and explains unsigned wraparound in reverse loops, stopping short of broader implementation details.
Examples
Uses a vector reverse-index loop whose unsigned counter wraps after reaching zero.
What you can do after
Diagnose reverse-loop crashes caused by unsigned wraparound and choose int when a negative loop condition is required.

Read how 100 C++ Mistakes and How to Avoid Them explains size_t →

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.