User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 397,646 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,436 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1981 | Replies: 2
Reply
Join Date: Nov 2004
Posts: 1
Reputation: bright2000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bright2000 bright2000 is offline Offline
Newbie Poster

How to print out the position of 2 dimension arrays?

  #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).
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Posts: 86
Reputation: MrScruff is an unknown quantity at this point 
Rep Power: 4
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?

  #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  
Join Date: Mar 2004
Posts: 717
Reputation: Phaelax is on a distinguished road 
Rep Power: 6
Solved Threads: 29
Phaelax Phaelax is offline Offline
Master Poster

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

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

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 11:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC