Register (keyword)
≈ 1 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
In the C programming language, register is a reserved word (or keyword), type modifier, storage class, and compiler hint to store a symbol in a CPU register.
In the C programming language, register is a reserved word (or keyword), type modifier, storage class, and compiler hint to store a symbol in a CPU register. volatile unsigned int special; unsigned int example() { register unsigned int my_reg asm("$4") = 32; my_reg += special; return my_reg; } When used, register is typically for loop counters, or possibly for other very frequently used variables in the code.
Examples
// store integer variable "i" in RAM, register, or other location as compiler sees fit int i = 0; // suggests storing integer variable "i" in a CPU register or other fast location register int i = 0;
See also
Optimizing compiler Program optimization Static (keyword)
Text derived from https://en.wikipedia.org/w/index.php?oldid=1332421917 under CC BY-SA 4.0; modifications have been made.