Message-ID: <390BAB86.7C1EF855@gtcom.net> From: Krogg X-Mailer: Mozilla 4.61 [en] (Win95; U) X-Accept-Language: en,en-US,en-GB,ja,af MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Array swapping. References: <390B75BB DOT 621F846A AT gtcom DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 54 Date: Sat, 29 Apr 2000 23:41:58 -0400 NNTP-Posting-Host: 12.6.67.158 X-Trace: eagle.america.net 957066312 12.6.67.158 (Sat, 29 Apr 2000 23:45:12 EDT) NNTP-Posting-Date: Sat, 29 Apr 2000 23:45:12 EDT Organization: 24hoursupport.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Chris Mears wrote: > > On Sat, 29 Apr 2000 19:52:27 -0400, that hoopy frood Krogg > wrote: > > > > >I got 2 arrays of same type/size. > > > >float abc[50][50]; > >float cba[50][50]; > > > >how can i "swap" them? > > > >so that abc[x][y] will now point to cba[x][y] and > >vice versa... > > > >I dont care if it is portable,just so long as > >it works and can be done over and over..... > > Uncompiled, untested. > > void swap(float a[50][50], float b[50][50]) > { > int i; > int j; > > for (i = 0 ; i < 50 ; i++) > { > for (j = 0 ; j < 50 ; j++) > { > float temp = a[i][j]; > a[i][j] = b[i][j]; > b[i][j] = a[i][j]; > } > } > } > Thats not what i am looking for... I want to swap witch array the array name points to in place. -- |"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""| | `.`/""""""\,',' my sig is too big, | |SEE HIS ( / \ \' SEE HIS but its really cool. | | FACE \/<> <>\/ SMILE | | / W \ Visit my ascii art site: | | ,'\_|||||_/`. http://www.gtcom.net/~krogg/ascii/ | | ,',' ||| `.`. krogg DOT no DOT to DOT spam AT gtcom DOT net | |____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|