naraku9333 Posted April 3, 2006 Report Share Posted April 3, 2006 Hello, I am trying to write a method that returns the index of a two dimensional array, I want to pass the array to the method and have it return the indices of a specific value. I am unclear if it is possible to return multple values (int's in my case) or if there is a better way. I know I can simply put the search algorithm in main, but Im trying to stick to a modular design (might as well get into the habit now). Any suggestions are well appreciated, thank you. Quote Link to post Share on other sites
jcl Posted April 3, 2006 Report Share Posted April 3, 2006 There's no simple way to return multiple values. The easy solution would be to return an int[2] containing the indices. Quote Link to post Share on other sites
naraku9333 Posted April 3, 2006 Author Report Share Posted April 3, 2006 There's no simple way to return multiple values. The easy solution would be to return an int[2] containing the indices.Ill look into that, what I initially wanted was to have the method ONLY search the array, pass the indices back to main to be passed to another method to change the value of the location. What I decided to do (at least for now) is pass the array to the method have it find and change the value and return the array, I dont know if this is an efficient way to do it but it works. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.