🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1898

strings no longer writable?

#1898
From: Mike Lijewski
Date: Mon, 29 Oct 1990 17:44
14 lines
917 bytes
My understanding is that strings are no longer writable.  That is to say,
the assignment to s[5] in the below program shouldn't be allowed.

main() { char *s = "testing"; s[5] = 'z'; }

Is a conforming implementation required to issue a warning, an error, or
what?

-- 
Mike Lijewski  (H)607/272-0238 (W)607/254-8686
Cornell National Supercomputer Facility
ARPA: lijewski@theory.tn.cornell.edu  BITNET: mjlx@cornellf.bitnet
SMAIL:  25 Renwick Heights Road, Ithaca, NY  14850
Technical Details
Message-ID: <1990Oct29.174410.28498@batcomputer.tn.cornell.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!batcomputer!lijewski

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!batcomputer!lijewski
From: lijewski@theory.tn.cornell.edu (Mike Lijewski)
Newsgroups: comp.std.c
Subject: strings no longer writable?
Message-ID: <1990Oct29.174410.28498@batcomputer.tn.cornell.edu>
Date: 29 Oct 90 17:44:10 GMT
Sender: lijewski@batcomputer.tn.cornell.edu (Mike Lijewski)
Organization: Cornell National Supercomputer Facility
Lines: 14