register keyword (C)

The register keyword in C suggests that the variable should be stored in a CPU register instead of memory for faster access.

register int b = 2;

Limitation: It’s only a hint, the compiler can definitely choose to ignore it.

Optimization: Modern compilers often optimize better without register.

register also exists in C++, but in C++17 and onwards, register is deprecated. Why???