String help!

Norman Diamond ndiamond at watdaisy.UUCP
Mon Mar 4 07:25:11 AEST 1985


> > You are allowed to say:
> > 
> > main()
> > {
> > 	char *ptr;
> > 	char *foo();
> > 
> > 	ptr = foo();
> > 	strcpy( ptr, "barfoo" );
> > 	.....
> > }
> > -- Michiel Huisjes.
> 
> In DEC C, string constants are read-only.  They are in a special, write-
> protected psect.  If you try to do something like the above, you will
> get a run-time error.  --  Jeff Lichtman

What does the standard say about this?  Can an implementation legally prevent
a C program from modifying storage accessed by a valid pointer?

-- 

   Norman Diamond

UUCP:  {decvax|utzoo|ihnp4|allegra}!watmath!watdaisy!ndiamond
CSNET: ndiamond%watdaisy at waterloo.csnet
ARPA:  ndiamond%watdaisy%waterloo.csnet at csnet-relay.arpa

"Opinions are those of the keyboard, and do not reflect on me or higher-ups."



More information about the Comp.lang.c mailing list