I\'m not talking about pointers to const values, but const pointers themselves.
I\'m learning C and C++ beyond the very basic stuff and just until today I realized t
If you do embedded systems or device driver programming where you have memory mapped devices then both forms of 'const' are often used, one to prevent the pointer from being reassigned (since it points to a fixed hardware address.) and, if the peripheral register it points to is a read-only hardware register then another const will detect a lot of errors at compile time rather than runtime.
A read-only 16 bit peripheral chip register might look something like:
static const unsigned short *const peripheral = (unsigned short *)0xfe0000UL;
Then you can easily read the hardware register without having to resort to assembly language:
input_word = *peripheral;