home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!cs.ubc.ca!larry.cs.ubc.ca!not-for-mail
- From: samuel@cs.ubc.ca (Stephen Samuel)
- Newsgroups: comp.sys.sgi
- Subject: Re: Does an Indigo make read-only text segments?
- Date: 22 Jan 1993 17:02:50 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Lines: 30
- Message-ID: <1jq5fqINN3hf@larry.cs.ubc.ca>
- References: <35088@adm.brl.mil>
- NNTP-Posting-Host: larry.cs.ubc.ca
-
- gml4410@ggr.co.uk (Lack Mr G M) writes:
-
- >Replying to:
- > Frank Perdicaro <frank@marvin.contex.com>
-
- > NO. There are 2 things here. If you declare something to be
- >"const" then the compiler should complain at *compile* time if you
- >attempt to modify it. It is *NOT* writeable. However, the
-
- Isn't always doable..
-
- ....
- char *astring="a constant string";
- ...
- playwith(astring);
- ....
-
- playwith(char * somestring; ){
- ...
- strcpy(somestring,"something else");
- ...
- }
-
- This gets especially difficult if the call and function are in different
- files. Granted, we could define type rules that make this impossible,
- but then... It might not be C anymore...
- --
- --
- Stephen Samuel (604)822-9248 samuel@cs.ubc.ca
- The first prerequisite to winning is playing the game.
-