How to print out the position of 2 dimension arrays?

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 1
Reputation: bright2000 is an unknown quantity at this point 
Solved Threads: 0
bright2000 bright2000 is offline Offline
Newbie Poster

How to print out the position of 2 dimension arrays?

 
0
  #1
Nov 27th, 2004
there are 2 dimension arrays, how can print out the position of value than 4?

for example

0 2 3 2 2 2
0 1 1 2 5 3
1 2 3 3 2 1

print out:
The pos is ( 4,1).
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 89
Reputation: MrScruff is an unknown quantity at this point 
Solved Threads: 0
MrScruff's Avatar
MrScruff MrScruff is offline Offline
Junior Poster in Training

Re: How to print out the position of 2 dimension arrays?

 
0
  #2
Nov 28th, 2004
You could construct two for loops which search through the array - one inside the other. Then when you find which value you are looking at - just print out the number each bit of the for loop got to.
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 802
Reputation: Phaelax is on a distinguished road 
Solved Threads: 40
Phaelax Phaelax is offline Offline
Practically a Posting Shark

Re: How to print out the position of 2 dimension arrays?

 
0
  #3
Nov 29th, 2004
didn't you post this on javaboutique as well? i posted an answer on there.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 2649 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC