From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c696,d10848107276edee X-Google-Attributes: gid10c696,public X-Google-Thread: 111c93,6331f57d343c4816 X-Google-Attributes: gid111c93,public X-Google-ArrivalTime: 2002-11-04 23:31:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!tudelft.nl!not-for-mail From: "Mark Swaanenburg" Newsgroups: comp.os.linux.development.apps,comp.os.linux.alpha Subject: Re: segfault and gcc-2.96 Date: Tue, 5 Nov 2002 08:31:29 +0100 Organization: Delft University of Technology Message-ID: References: <3DC324DA.4C495AEC@lmco.nospam.com> <3DC70390.3C7CDB89@lmco.nospam.com> <878z08vonz.fsf@student.uni-tuebingen.de> NNTP-Posting-Host: users.linvision.com X-Trace: news.tudelft.nl 1036481489 21251 62.58.92.114 (5 Nov 2002 07:31:29 GMT) X-Complaints-To: usenet@news.tudelft.nl NNTP-Posting-Date: Tue, 5 Nov 2002 07:31:29 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: archiver1.google.com comp.os.linux.development.apps:27395 comp.os.linux.alpha:6570 "Falk Hueffner" wrote in message news:878z08vonz.fsf@student.uni-tuebingen.de... > JMK writes: > > > char *f1 = "default.str"; > > ... > > strcpy (f1, pfix); <-------- Program received signal SIGSEGV, > > String literals are not writable. They are of type const char*. > > -- > Falk I would try it this way: char f1[ ] = {"default.str"}; I guess this would just create an 12 byte array which is writeable. Mark