From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luciano Moreira - igLnx Subject: Re: pass 2 D array in C Date: Thu, 14 Oct 2004 10:08:46 -0300 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: <416E7A5E.6090603@ig.com.br> References: <20041014112615.91429.qmail@web52901.mail.yahoo.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20041014112615.91429.qmail@web52901.mail.yahoo.com> List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Ankit Jain Cc: linux prg The following sample was coded now, without compiling, then It can have some mistakes for compiler. But I think that it ll can be good for your analyse. Using this sample, you can allocate any kind of array, like as 3D, 4D, 5D, and so on. Luciano ----------------------------------------------------------------------------------------- main() { int THE_LENGTH = 200; /* Numbers of itens of array */ long **p2DArray; pp2DArray = new long[THE_LENGTH]; /* for C-ANSI: pp2DArray = malloc(sizeof(long) * THE_LENGTH); */ fill_array(pp2dArray, THE_LENGTH); dump_array(pp2dArray, THE_LENGTH); delete pp2DArray; /* forC-ANSI: free(pp2DArray); */ } fill_array(char *pp, int nLength) { int ct; for ct(=0; ctits a simple question... > >how to pass a 2 D array address in C > >is there any way by **pointer? > >thanks > >ankit > >________________________________________________________________________ >Yahoo! Messenger - Communicate instantly..."Ping" >your friends today! Download Messenger Now >http://uk.messenger.yahoo.com/download/index.html >- >To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html > > > >