X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3C8A5484.2D4563D7@earthlink.net> From: Martin Ambuhl Organization: Nocturnal Aviation X-Mailer: Mozilla 4.77 [en] (Win95; U) X-Accept-Language: en,de-CH,fr,ru,zh-CN,ja MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: general protection fault error References: Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Lines: 19 Date: Sat, 09 Mar 2002 18:29:15 GMT NNTP-Posting-Host: 209.246.105.254 X-Complaints-To: abuse AT earthlink DOT net X-Trace: newsread1.prod.itd.earthlink.net 1015698555 209.246.105.254 (Sat, 09 Mar 2002 10:29:15 PST) NNTP-Posting-Date: Sat, 09 Mar 2002 10:29:15 PST X-Received-Date: Sat, 09 Mar 2002 10:29:17 PST (newsmaster1.prod.itd.earthlink.net) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "S. Kaleyta" wrote: > > Is it possible to delete a pointer? I get a "general protection fault" > error when compiled and run on my pc but not on my unix box. > > Code segment: > int *pnt; > pnt = # > delete pnt; Use delete and delete[] only for storage obtained through 'new', just as you use free() only for storage obtained through the *alloc() family. Doing otherwise (as in your fragment) is meaningless. -- It is better that the grammarians should chide us than that the people should not understand us. - St. Augustine