Register keyword
The register keyword is a C storage-class specifier for automatic objects that may request register storage and restricts taking the object's address.
Modern C, Third Edition
register is a C storage-class specifier that requests automatic storage for an object and permits implementation-specific restrictions on taking its address.
- How it is used
- Uses register to restrict address-taking and expose non-aliasing opportunities for automatic local objects.
- How deep it goes
- Explains automatic lifetimes, recursion, address restrictions, aliasing, and array complications, but does not develop compiler implementation details.
- Examples
- Uses local variables, recursive calls, non-array performance-critical variables, and arrays whose elements undergo address decay.
- What you can do after
- Apply register to selected local variables while preserving address-taking constraints and accounting for array behavior.
Read how Modern C, Third Edition explains register keyword →
Modern C
The register keyword is a C storage-class specifier that requests register storage and restricts use of the object's address in applicable contexts.
- How it is used
- Uses register declarations to restrict address-taking in local, performance-sensitive code and expose possible aliasing.
- How deep it goes
- Explains automatic lifetime, recursion, address prohibition, aliasing, and array limitations, but does not develop compiler implementation details.
- Examples
- Uses block-scope locals, recursive calls, address-taking, non-array variables, and arrays as contrasting cases.
- What you can do after
- Apply it via C declarations to diagnose unintended address-taking and communicate potential aliasing constraints to the compiler.
Related concepts
- address-of operatorcontrasts with · The address-of operator is a unary operator that produces a pointer to the object or function designated by its operand.
- aliasaddresses · An alias is an alternative name by which an entity, command, parameter, or resource can be referred to.
- hardware registeruses · A hardware register is a small, rapidly accessible storage location within a processor or processing device that holds data, addresses, or control information during execution.
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.

