Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!rutgers!njin!princeton!taylor!ssr From: ssr@taylor.Princeton.EDU (Steve S. Roy) Newsgroups: comp.lang.c++ Subject: Re: delete [] Keywords: arrays, new&delete Message-ID: <1568@idunno.Princeton.EDU> Date: 1 Aug 90 13:43:07 GMT References: <641@atcmpe.atcmp.nl> <1990Jul27.231220.8396@cerc.utexas.edu> <4937@pegasus.ATT.COM> <4942@pegasus.ATT.COM> Sender: news@idunno.Princeton.EDU Reply-To: ssr@taylor.Princeton.EDU (Steve S. Roy) Organization: Princeton University Lines: 15 In article <4942@pegasus.ATT.COM> hansen@pegasus.ATT.COM (Tony L. Hansen) writes: > > "X *x = new X[m]" means to allocate an array of objects of type X, using > only the global operator ::new(), invoke the appropriate constructor for > x[0] through x[m-1], and assign a pointer to the array to the pointer x. > The 1990 definition of C++ also mandates that the C++ environment > remember the value m associated with that pointer. > Sorry, but I don't have docs for 2.1 available. Is there any way for me to get at the size of that array without remembering it thru my code? That way I could, say, iterate over all elements of the array without having a stupid variable like n_x around. Steve