From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: VESA 1.2 Again.. And also an array of pointers Date: Mon, 01 Mar 1999 14:51:47 -0400 Organization: BrunNet Lines: 32 Message-ID: <36DAE1C3.14680E28@unb.ca> References: <36D2EEAD DOT AFEA8808 AT geocities DOT com> NNTP-Posting-Host: ftnts4c50.brunnet.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com The Beyonder wrote: > But first I need to learn how to create an array of > pointers (dynamic array). Is it done like this: > > long int *alpha = (long int *) malloc( number ); > > alpha[x] = (long int *) address; > > I seriously think that this is wrong, how do I do it this? long int** alpha = (long int **) malloc(number_of_expected_pointers); alpha[x] = (long int *) address; With a single '*', you are only making an array of 'long int's. The second '*' makes it an array of integer pointers. Remember, each entry in that array (each alpha[x]) will have to be individually initialized: for(int x=0; x