A new feature introduced in the
C99 standard is the
restrict qualifier.
restrict is a simple and useful qualifier. All it means is that (for the scope of the
restrict-ed pointer declaration) no
other pointer will access the data pointed to by this pointer.
Why would you do this? Well, it is supposed to act as a hint to compilers, allowing them to perform optimizations they could not otherwise do which is nice.
One caveat though:
restrict is not in the
C++ standard so only
C programs are expected to use this keyword. (If you aren't sure of the difference between C and C++
read this post).