The C standard states that if an attempt is made to change a const type,the result is implementation defined.This gives error on my system,but what does it depend on(compiler,os)? What are the possible results(implementation defined) on various machines?
You seems to have misunderstood the C standard. Trying to modify a const-qualified variable is a constraint violation and must therefore result in a diagnostic message from the compiler.
If you try to subvert that mechanism (for example, by casting away the
const), then you are on your own. Trying to modify an object that was defined as
const results in Undefined Behaviour, which means that literally anything is possible. There is no implementation-defined behaviour within the context of
const in the C standard.