const
Walter Bright
newshound1 at digitalmars.com
Thu Apr 3 03:17:03 PDT 2008
Don Clugston wrote:
> Ditto. Come on, even non-programmers know what "read only access" means.
> I find it hard to believe there would be many people who'd have trouble
> grasping the idea that "read only" means "look but don't touch". Are
> there any languages where 'readonly' is used for putting values into
> ROM?
Yes, there are C extensions to do just that. Secondly, there is often
hardware memory protection available, which has a "read only" bit. That
means the data cannot be changed. Files marked "read only" cannot be
written to by anyone. Read only has a long history of meaning immutable
by anything, not just the viewer.
"The readonly storage-class modifier, like the const data-type
qualifier, assigns the NOWRT attribute to the variable's program
section; if used with the static or globaldef specifier, the variable is
stored in the $CODE psect, which has the NOWRT attribute by default." --
http://h71000.www7.hp.com/commercial/c/docs/5492profile_017.html
More information about the Digitalmars-d
mailing list