register keyword

The register keyword indicates the compiler to try to store the variable in a CPU register.

int main() {
    for(register int i = 0 ; i < 10 ; i++) {

    }
}

1. Deprecation

This is deprecated since C++111 (No warning), it has no effect if u use it.

A warning pops since C++172

<source>: In function 'int main()':
<source>:2:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    2 |     for(register int i = 0 ; i < 10 ; i++) {
      |                      ^
Compiler returned: 0

Footnotes: