Basically, if you know what you are doing, you can safely remove "const" declaration -
In this case, since the const is used in an exported header file, you would have to know what _everybody else_ is doing as well, including external module writers. Or they would have to know what they are doing. I don't think either can be assumed to be true.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2004-03-11 20:58: Subject: Re: const
On Thu, Mar 11, 2004 at 08:35:02PM +0100, Mirar @ Pike developers forum wrote:
it works if I remove the "const". But is it the correct solution? const in C confuses me.
Basically, if you know what you are doing, you can safely remove "const" declaration - it is used (mostly) only to prevent accidental modification access (i.e. - obvious attempt to modify, visible to compiler at compile-time).
Of course, the presence of "const" won't make any structure read-only ( not in standard C, at least) :)
Regards, /Al
/ Brevbäraren