From: Mark Phillips Newsgroups: comp.os.msdos.djgpp Subject: Re: Dynamic Array - Need HELP Date: Sun, 4 Jul 1999 22:55:43 -0500 Organization: The University of Manitoba Lines: 28 Message-ID: References: NNTP-Posting-Host: gold.cs.umanitoba.ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: canopus.cc.umanitoba.ca 931146950 20695 130.179.24.1 (5 Jul 1999 03:55:50 GMT) X-Complaints-To: Postmaster AT cc DOT umanitoba DOT ca NNTP-Posting-Date: 5 Jul 1999 03:55:50 GMT In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > I want to create a array of size mpx by mpy. > After this code, sizeof(v) = 8, why ??? > well, because v is a pointer to a pointer, and the size of any pointer is 8 bytes. don't worry, your memory is allocated fine, it's just that since it is dynamically allocated, you can't use sizeof() to check how much memory you allocated. mark > unsigned char **v; > int mpx,mpy,i; > > mpx=64; > mpy=48; > > v = new unsigned char*[mpy]; > for(i=0;i { > v[i]=new unsigned char[mpx]; > } > > > > >