954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to print out the position of 2 dimension arrays?

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).

bright2000
Newbie Poster
1 post since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

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.

MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

didn't you post this on javaboutique as well? i posted an answer on there.

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You