delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/01/25/04:08:49

Xref: news2.mv.net comp.os.msdos.djgpp:584
From: 5709kelnhofe AT vms DOT csd DOT mu DOT edu (Richard W. Kelnhofer)
Newsgroups: comp.os.msdos.djgpp
Subject: Dyn Mem Allocation using new and delete in dgjpp g++
Date: 23 Jan 1996 16:36:48 GMT
Organization: Marquette University - Computer Services
Lines: 18
Message-ID: <0099CD07.29EC49B7@vms.csd.mu.edu>
Reply-To: 5709kelnhofe AT vms DOT csd DOT mu DOT edu
NNTP-Posting-Host: vmsb.csd.mu.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I created a class in c++ to implement interval numbers and vectors
of interval numbers.  The vector class uses new and delete in
the constructors and destructors to allocate and deallocate memory
from the free store.  This works well on most platforms.  However,
I was getting segmentation violations when running code compiled
with djgpp on a PC.  I solved the problem by placing the implementation
code for the constuctors and destructors inside the class definitions.

I was curious if this is normal or if anyone has had similar experiences?


--------------------------------------------------------------
| Richard W. Kelnhofer, P.E.   | 5709kelnhofe AT vms DOT csd DOT mu DOT edu |                
| Marquette University         |                             |
| Milwaukee, WI                |                             |
--------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019