Register (keyword)
Register (keyword) is an encyclopedia record, sourced from en.wikipedia.org, last updated 2026-01-11, source revision https://en.wikipedia.org/w/index.php?oldid=1332421917. 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. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
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) ==References==
Cite this
"Register (keyword)". 1768159312. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1332421917 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy