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?
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:
Sign up
Sign up
Here's how it works:
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
|
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 |
|||||||||||||
|