I want to know about const internals in c and c++ . How compiler imposes constantness ? Can some one help me please.
In addition to the compile-time enforced immutability provided by using the const keyword that other answers to your question have already mentioned, using it sometimes allows the compiler to place such data in the read-only section of a binary and memory. According to Section 2.4.2 "Forever const" in Ulrich Drepper's article How To Write Shared Libraries doing so potentially allows programs to (1) use less resources and (2) start up faster.
Note that casting away the constness of data in such read-only areas of memory results in the undefined behavior, as usual.