I am not restricted from doing an assignment operation on a constant
datatype ( say, an int ) but just warned of the consequence. why?
You've already posted a question similar to this. Wait a few hours for
responses, since Usenet is slower than web forums.
Coming to your question, int is not a constant data type. It is an integer
type whose specific instances, i.e., objects of the type, can be
*qualified* with the 'const' qualifier, to indicate to the compiler that
the program should not modify the value of the object after it's
initialisation. It's mainly to prevent inadvertent modifications by the
programmer, and to allow the compiler to optionally perform optimisations
on the object, like storing it in read-only memory.
An attempt to modify a const qualified object invokes implementation
dependent behaviour. The standard mandates a compiler to diagnose attempts
to modify a const qualified object after it's initialisation, but places no
other restrictions upon it, with regard to this erroneous construct.
In summary, don't try to pull such apparently clever tricks. It's just
likely to get you into trouble.