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.
What to know first
- compound literalA compound literal is a C expression consisting of a parenthesized type name followed by an initializer that creates an unnamed object.
- objectAn object is a distinct computational entity or value represented with associated data, structure, identity, or behavior.
- variable-length arrayA variable-length array is an array whose bound is determined at run time rather than fixed as a compile-time constant.
Related concepts
- keywordkind of · A language-defined word or token with a predefined syntactic or semantic role, which may be restricted from use as an ordinary identifier.
- 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.
- keywordkind of · A keyword is a word or phrase with special significance for representing a topic, information need, content relevance, or syntactic role.
- 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.
Questions about register keyword
What is 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.
Which Manning books explain register keyword?
Modern C, Third Edition and Modern C.
What should I know before learning register keyword?
Manning books that teach register keyword usually introduce compound literal, object and variable-length array first.
What is the difference between register keyword and address-of operator?
The register keyword is a C storage-class specifier for automatic objects that may request register storage and restricts taking the object's address. The address-of operator is a unary operator that produces a pointer to the object or function designated by its operand.
What is register keyword a kind of?
Register keyword is a kind of keyword. A language-defined word or token with a predefined syntactic or semantic role, which may be restricted from use as an ordinary identifier.
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.

