[Ilugc] Ansi C and 'const' modifier
- From: sridharinfinity@xxxxxxxxx (Sridhar R)
- Date: Wed Aug 11 16:56:04 2004
Anand Kumar Saha <anand.kumar@xxxxxxxxxx> wrote:
| This program
| const int a=10;
what happens when you run this program ? does it run properly
or give you a core ?
It runs cleanly.
Okay, the doubt is now cleared. From K&R ...
The result is implementation-defined if an attempt is made to change a const.
That makes sense for gcc to fire warning instead of error (a=20).
Sridhar - http://cs.annauniv.edu/~rsridhar
Other related posts: