Path: utzoo!utgpu!watserv1!watmath!att!news.cs.indiana.edu!sdd.hp.com!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Question of new and realloc() Message-ID: <568@taumet.com> Date: 25 Jan 91 16:45:21 GMT References: <1991Jan24.131035.4634@cc.helsinki.fi> Organization: Taumetric Corporation, San Diego Lines: 18 teittinen@cc.helsinki.fi (Marko Teittinen) writes: >Can I use realloc() to handle pointers created by new-operator? Can this >cause any troubles? I'd like to use new-operator to minimize pointer >type casts and because it does arrays right without sizeof-calculations. >Why is there no resize-operator that would make the same thing as >realloc()... One use of "new" is to allocate an array of simple objects. Another is to allocate space for an object with a constructor. In the latter case, what would be the semantics of a realloc operator? It makes no sense, given strong typing, to extend the size of a single class object. There are possible uses for a realloc operator, but the semantics get a little muddy. -- Steve Clamage, TauMetric Corp, steve@taumet.com