C++ register Keyword
Definition and Usage
The register keyword was used to suggest that a variable should be stored in a CPU register (a very small and fast memory inside the processor), like register int x = 5;.
Modern compilers decide this on their own, so the keyword was usually ignored. It was deprecated (marked as outdated) in C++11 and removed in C++17. The word is still reserved, so you cannot use it as a name.
Do not use register in new code. A program that uses it may not compile with newer versions of C++.
Related Pages
Read more about variables in our C++ Variables Tutorial.